freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Git][freetype/freetype-demos][gsoc-2022-chariri] 9 commits: [ftinspect]


From: Charlie Jiang (@cqjjjzr)
Subject: [Git][freetype/freetype-demos][gsoc-2022-chariri] 9 commits: [ftinspect] Move out font file managing/watching out to a new class.
Date: Sat, 02 Jul 2022 11:59:29 +0000

Charlie Jiang pushed to branch gsoc-2022-chariri at FreeType / FreeType Demo Programs

Commits:

  • 8cc92c54
    by Charlie Jiang at 2022-06-30T18:21:36+08:00
    [ftinspect] Move out font file managing/watching out to a new class.
    
    * src/ftinspect/maingui.hpp, src/ftinspect/maingui.cpp: Move `fontList`,
    `fontWatcher` and `timer` and other code related to font file managing to
    new class `FontFileManager`.
    
    * src/ftinspect/engine.hpp, src/ftinspect/engine.cpp: `Engine` class now
    holds `FontFileManager`.
    Also, make `MainGUI` open and close fonts indirectly via `Engine`.
    
    * src/ftinspect/fontfilemanager.hpp, src/ftinspect/fontfilemanager.cpp: New
    files.
    
    * src/ftinspect/CMakeLists.txt, src/ftinspect/meson.build: Updated.
    
    TODO: Maybe we should remove dependency against `FontFileManager` from
    `MainGUI`?
    
  • 1f0ead70
    by Charlie Jiang at 2022-06-30T18:39:28+08:00
    [ftinspect] Decouple `Engine` from `MainGUI`.
    
    Relevant info can be found in #13. This commit removes dependency against
    `MainGUI` from `Engine` class. All settings will be explicitly passed via
    setters of `Engine`. Also see `MainGUI::syncSettings` and simplified
    `Engine::update`.
    
    This commit removes friend relation between the two classes.
    
    TODO: Some GUI components in MainGUI lacks proper connections. When changing
    their value, the glyph isn't updated in time.
    
    * src/ftinspect/ftinspect.cpp: No longer need to pass GUI when constructing
    `Engine`.
    
    * src/ftinspect/maingui.hpp: Move `AntiAliasing` enum to `Engine` class, add
    `syncSettings` function, reorder some functions.
    
    * src/ftinspect/maingui.cpp: Because of the removal of friend relationship,
    change all access to private fields of `Engine` to getter/setter call.
    Add implementation of `syncSettings`, and make sure it's called before
    loading font and rendering. Moving of `AntiAliasing` enum is also taken care
    of.
    
    * src/ftinspect/engine/engine.hpp: Removed dependency against `MainGUI`.
    Added getters/setters and reordered some functions. The default values
    queried from engine are all grouped together into `EngineDefaultValues`
    struct.
    Added `queryEngine` function (see below).
    New `setSizeByPoint` and `setSizeByPoint` lifted the branch to `MainGUI`.
    Note: Setters of LCD filter mode, CFF mode and TTI version now accepts the
    actual values of FreeType instead of values of enums in `MainGUI` used to
    initialize combo boxes.
    However, `antiAliasingMode` is still using enum values (but moved into
    `Engine`) because it's complex to convert to FreeType value.
    
    * src/ftinspect/engine/engine.cpp: `faceRequester` now use the `Engine`
    object instead of `MainGUI` as `requestData`.
    Moved code preparing engine default values to the `queryEngine` function.
    Moved some single-line getters to the header file to benefit from inlineing.
    Simplified `update` function since we no longer need to actively fetch
    settings.
    `usingPixelSize` is used to determine if pixel or point unit is used. This
    flag is updated by `setSizeByPixel` and `setSizeByPoint` functions.
    
  • 5771bdf9
    by Charlie Jiang at 2022-06-30T18:39:28+08:00
    [ftinspect] Rename all private member variables with an underscore suffix.
    
    (pure mechnical commit)
    
    * src/ftinspect/**: Renaming. Also some variables with abbreviations
    were renamed.
    
    This will enable nicer getter/setters, as discussed in #13.
    
  • 5f380ae9
    by Charlie Jiang at 2022-07-01T14:18:58+08:00
    [ftinspect] Use custom `QAbstractListModel` instead of manually mapping.
    
    In `maingui.cpp`, mapping between `QComboBox` indices and actual FreeType
    values was done manually. The enabled statuses of individual ComboBox items
    were also maintained in `maingui.cpp`.
    
    In this commit, those code was moved to seperate custom classes implementating
    `QAbstractListModel`. All mapping was done there. Statuses was maintained
    in the classes as well. By doing this, the reason why some items were disabled
    was made more clear and explicit, and adding more items is more easy.
    
    The `QComboBoxx` custom widget was no longer needed since disable flag can be
    provided by the custom model by overriding the `flags` function.
    
    `SimpleComboBoxModel` is a basic class for Key-Value-DisplayName mapping.
    Other models could extend this class if no complicated mapping (e.g.
    `HintingModeComboBoxModel`) is needed.
    
    * src/ftinspect/models/ttsettingscomboboxmodel.cpp,
      src/ftinspect/models/ttsettingscomboboxmodel.cpp: New files.
      `HintingModeComboBoxModel`, `SimpleComboBoxModel`, `LCDFilterComboBoxModel`
      and `AntiAliasingComboBoxModel` is defined here.
    
    * src/ftinspect/engine/engine.cpp, src/ftinspect/engine/engine.hpp:
      `Engine` now accepts "load target" value of certain anti-aliasing mode
      instead of the anti-aliasing enum value. The mapping was moved into
      `AntiAliasingComboBoxModel`.
    
    * src/ftinspect/maingui.cpp, src/ftinspect/maingui.hpp: Move all mappings
      and enabled/disabled statuses to separate models.
      Remove mapping `QHash`es. Use `QComboBox` instead of `QComboBoxx`.
    
    * src/ftinspect/meson.build, src/ftinspect/CMakeLists.txt: Updated.
    
  • 96390184
    by Charlie Jiang at 2022-07-01T20:27:52+08:00
    [ftinspect] Directly pass `Engine` object to constructor of `MainGUI`
    
    Because there's no bidirectional dependency between `Engine` and `MainGUI`,
    we no longer need `MainGUI::update` func and can directly pass the `Engine`
    object to `MainGUI`. This also make `engine_` variable available immediately
    in the constructor of `MainGUI`.
    
    * src/ftinspect/maingui.cpp, src/ftinspect/maingui.hpp: As described.
    
  • 03fda0ea
    by Charlie Jiang at 2022-07-02T19:41:23+08:00
    [ftinspect] Move settings panel to a separate class.
    
    This commit moves the settings on the left to a new `SettingPanel` class.
    `check*` functions were re-organized so all manipulations against `Engine`
    was grouped together (in `syncSettings` and `setDefaults`) and made clear.
    
    Also, the glyph repaint/font reload events were more explicitly emitted, which
    is beneficial to demonstrating.
    
    TODO: More test are needed to ensure that the behaviors aren't changed.
    
    * src/ftinspect/engine/engine.cpp: Fix: when resetting the cache manager, the
    current `ftSize_` must be invalidated.
    
    * src/ftinspect/maingui.cpp: Move out all settings on the left. When settings
    in the panel were changed, `MainGUI` will be notified via the
    `SettingPanel::fontReloadNeeded` and `SettingPanel::repaintNeeded` signals.
    
    src/ftinspect/panels/settingpanel.cpp, src/ftinspect/panels/settingpanel.hpp:
    New file.
    
    * src/ftinspect/CMakeLists.txt, src/ftinspect/meson.build: Updated.
    
  • 3a53026e
    by Charlie Jiang at 2022-07-02T19:57:31+08:00
    [ftinspect] Re-organize custom widgets.
    
    (pure mechnical commit)
    
    * src/ftinspect/maingui.hpp: Switch from individual widget files to the newly
    merged one.
    
    * src/ftinspect/widgets/custom_widgets.{cpp, hpp}: All 4 custom widgets.
    
    * src/ftinspect/widgets/qcomboboxx.{cpp, hpp}: Merged into custom_widgets.
    
    * src/ftinspect/widgets/qgraphicsviewx.{cpp, hpp}: Merged into custom_widgets.
    
    * src/ftinspect/widgets/qpushbottonx.{cpp, hpp}: Merged into custom_widgets.
    
    * src/ftinspect/widgets/qspinbox.{cpp, hpp}: Merged into custom_widgets.
    
    Those widgets could be considered "auxiliary components", and are pretty far
    from the core logic. Therefore, they should be made less "loud" (it's 8 source
    files out of 23 in total - more than 1/3 !).
    
  • 6b4321d0
    by Charlie Jiang at 2022-07-02T19:57:35+08:00
    [ftinspect] Add documentation to custom widgets.
    
    * src/ftinspect/widgets/custom_widgets.hpp: Add doc at the beginning of the
    file.
    
  • 0976b852
    by Charlie Jiang at 2022-07-02T19:57:35+08:00
    [ftinspect] Remove `QComboBoxx`
    
    We no longer need a custom `QComboBox` for disabling individual items in the
    combo box. Our custom `QAbstractListModel` has done this already.
    
    * src/ftinspect/widgets/custom_widgets.cpp,
      src/ftinspect/widgets/custom_widgets.hpp: Remove `QComboBoxx`.
    

30 changed files:

The diff was not included because it is too large.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]