|
1
|
+# Data Flow and Event
|
|
2
|
+
|
|
3
|
+This document describes how data such as settings and parameters flows between
|
|
4
|
+components in `ftinspect`, and how events are wired between objects.
|
|
5
|
+
|
|
6
|
+There's 2 major types of setting: "Active" and "Passive". When an active setting
|
|
7
|
+is changed on the GUI, the event handler will actively push it to the engine.
|
|
8
|
+When a passive setting is changed, it won't be immediately pushed all way down
|
|
9
|
+to the underlying engine. They're passively applied to the engine on every
|
|
10
|
+render event.
|
|
11
|
+
|
|
12
|
+Below will list all settings and status values used in the project.
|
|
13
|
+
|
|
14
|
+## Common Info and Settings
|
|
15
|
+
|
|
16
|
+Most of these settings comes from the left panel. They're common across all
|
|
17
|
+modes.
|
|
18
|
+
|
|
19
|
+When they're modified, after internal processing of `SettingPanel`, the
|
|
20
|
+`SettingPanel` will emit a signal, either `repaintNeeded` or `fontReloadNeeded`.
|
|
21
|
+`MainGUI` is responsible to catch the signal. For the former one, it will just
|
|
22
|
+notify the current active tab to repaint its view. For the latter one, it will
|
|
23
|
+first reload the font in `Engine`, then notify the current tab that the font has
|
|
24
|
+changed. During the process, active settings are already applied to the Engine
|
|
25
|
+by `SettingPanel`, and passive settings will be applied when repainting.
|
|
26
|
+
|
|
27
|
+Passive settings are applied to the engine via `SettingPanel::syncSettings`
|
|
28
|
+function.
|
|
29
|
+
|
|
30
|
+Notation: `->` single arrows means calling hierarchy, and `=>` double arrows
|
|
31
|
+ means temporal sequence (i.e. one happens after another, but not one
|
|
32
|
+ calls another).
|
|
33
|
+
|
|
34
|
+Currently there's only one active setting here:
|
|
35
|
+
|
|
36
|
+- Hinting Mode: `checkHintingMode` (map using model) -> engine setters -> `FT_Property_Set` => emit reload font
|
|
37
|
+
|
|
38
|
+Passive common settings are:
|
|
39
|
+
|
|
40
|
+- Hinting On/Off
|
|
41
|
+ `checkHinting` (may change hinting mode!) -> emit repaint -> `syncSettings` => `Engine::update` -> load flags
|
|
42
|
+- Hinting Debug Switches (hor. / vert. hinting etc...)
|
|
43
|
+ repaint -> `syncSettings` => not implemented in Engine
|
|
44
|
+- Auto Hinting On/Off
|
|
45
|
+ `checkAutoHinting` -> emit repaint -> `syncSettings` => `Engine::update` -> load flags
|
|
46
|
+- Anti Aliasing Mode
|
|
47
|
+ `checkAntiAliasing` -> emit repaint -> `syncSettings` (map using model) => `Engine::update` -> load flags
|
|
48
|
+- LCD Filter Mode
|
|
49
|
+ repaint -> `syncSettings` (map using model) -> `Engine::setLcdFilter` -> `FT_Library_SetLcdFilter`
|
|
50
|
+- Gamma Value
|
|
51
|
+ repaint -> `syncSettings` => not implemented in Engine
|
|
52
|
+
|
|
53
|
+Info:
|
|
54
|
+
|
|
55
|
+- Font Glyph Count
|
|
56
|
+ `loadFont` -> `FTC_Manager_LookupSize` => stored in `curNumGlyphs_`
|
|
57
|
+- Font Type
|
|
58
|
+ `loadFont` -> `FT_FACE_DRIVER_NAME` => stored in `fontType_`
|
|
59
|
+- Available CharMaps (incl. Max index for each charmap)
|
|
60
|
+ `loadFont` -> computed & stored in `curCharMaps_`
|
|
61
|
+- Font Family Name & Style Name
|
|
62
|
+ `loadFont` -> stored in `curFamilyName_` & `curStyleName_`
|
|
63
|
+
|
|
64
|
+## Settings and Info in the Singular View
|
|
65
|
+
|
|
66
|
+There's currently no active setting in the Singular View.
|
|
67
|
+
|
|
68
|
+These parameters are used in the Sinuglar View:
|
|
69
|
+
|
|
70
|
+- Current Glyph Index
|
|
71
|
+ `GlyphIndexSelector::currentIndexChanged` -> `setGlyphIndex` (stored in `currentGlyphIndex_`) -> reprint -> `Engine::loadOutline` -> `FTC_ImageCache_LookupScaler`
|
|
72
|
+- Font Size
|
|
73
|
+ `FontSizeSelector::valueChanged` -> `repaintGlyph` -> `syncSettings` -> `FontSizeSelector::applyToEngine` => `Engine::update` -> scaler width/height
|
|
74
|
+- Zoom Factor
|
|
75
|
+ `zoom` -> glyph view transform => emit update grid
|
|
76
|
+- Show Points
|
|
77
|
+ `checkShowPoints` -> repaint (used in painting)
|
|
78
|
+- Show Bitmap & Show Point Numbers & Show Outlines On/Off
|
|
79
|
+ repaint (used in painting)
|
|
80
|
+
|
|
81
|
+And these values are obtained from the engine in the Singular View:
|
|
82
|
+
|
|
83
|
+- Current Glyph Count (a.k.a. Limit Index)
|
|
84
|
+ (see above "Common Info") -> `reloadFont` (stored in `currentGlyphCount_`) -> `GlyphIndexSelector::setMinMax` -> min/mas for spin box
|
|
85
|
+
|
|
86
|
+## Settings and Info in the Continuous View
|
|
87
|
+
|
|
88
|
+Settings in the sub tabs are pulled using `updateFromCurrentSubTab` when
|
|
89
|
+repainting. Info is pushed via `updateCurrentSubTab` when reloading font.
|
|
90
|
+
|
|
91
|
+### Common Settings and Info
|
|
92
|
+
|
|
93
|
+- Font Size
|
|
94
|
+ `FontSizeSelector::valueChanged` -> repaint -> `FontSizeSelector::applyToEngine`
|
|
95
|
+ May also be alter via scrolling: `wheelResize` -> `FontSizeSelector::handleWheelResizeBySteps` -> spin box value
|
|
96
|
+- Current Glyph Count
|
|
97
|
+ (see above "Common Info") -> `reloadFont` (stored in `currentGlyphCount_`)
|
|
98
|
+- Mode
|
|
99
|
+ repaint -> `updateFromCurrentSubTab` (stored in canvas) => `GlyphContinuous::paintEvent`
|
|
100
|
+
|
|
101
|
+### All Glyphs Mode
|
|
102
|
+
|
|
103
|
+(all passive)
|
|
104
|
+
|
|
105
|
+Settings:
|
|
106
|
+
|
|
107
|
+- SubMode
|
|
108
|
+ repaint -> `updateFromCurrentSubTab` (stored in canvas) => `GlyphContinuous::paintEvent`
|
|
109
|
+- Current Glyph Index
|
|
110
|
+ `GlyphIndexSelector::currentIndexChanged` -> repaint -> `updateFromCurrentSubTab` (stored in canvas) => `GlyphContinuous::paintEvent`
|
|
111
|
+- Current CharMap
|
|
112
|
+ repaint -> `updateFromCurrentSubTab` (stored in canvas) => `GlyphContinuous::paintEvent`
|
|
113
|
+ May also be updated when setting available charmaps
|
|
114
|
+- Limit Index (max index if charmap is used, otherwise glyph count)
|
|
115
|
+ Triggered when current charmap or glyph count changes.
|
|
116
|
+ `updateLimitIndex` -> stored in `glyphLimitIndex_` => `updateFromCurrentSubTab` (stored in canvas) => `GlyphContinuous::paintEvent`
|
|
117
|
+
|
|
118
|
+Info:
|
|
119
|
+
|
|
120
|
+- Available CharMaps
|
|
121
|
+ (see above "Common Info", already stored in engine) -> `reloadFont` -> `updateCurrentSubTab` -> `ContinousAllGlyphsTab::setCharMaps`
|
|
122
|
+- Current Glyph Count
|
|
123
|
+ (see above "Common Info", already stored in engine) -> `reloadFont` -> `updateCurrentSubTab` -> `ContinousAllGlyphsTab::setGlyphCount` (stored in `currentGlyphCount_`)
|
|
124
|
+- Displaying Count
|
|
125
|
+ repaint -> `GlyphContinuous::paintEvent` -> `GlyphContinuous::displayingCountUpdated` -> `ContinousAllGlyphsTab::setDisplayingCount` -> `GlyphIndexSelector::setShowingCount` |
|
|
\ No newline at end of file |