diff options
Diffstat (limited to 'src/fontpack.h')
-rw-r--r-- | src/fontpack.h | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/src/fontpack.h b/src/fontpack.h index fb8d757e..5d592822 100644 --- a/src/fontpack.h +++ b/src/fontpack.h | |||
@@ -110,22 +110,23 @@ iDeclareType(FontSpec) | |||
110 | iDeclareTypeConstruction(FontSpec) | 110 | iDeclareTypeConstruction(FontSpec) |
111 | 111 | ||
112 | enum iFontSpecFlags { | 112 | enum iFontSpecFlags { |
113 | override_FontSpecFlag = iBit(1), | 113 | user_FontSpecFlag = iBit(1), /* user's standalone font, can be used for anything */ |
114 | monospace_FontSpecFlag = iBit(2), /* can be used in preformatted content */ | 114 | override_FontSpecFlag = iBit(2), |
115 | auxiliary_FontSpecFlag = iBit(3), /* only used for looking up glyphs missing from other fonts */ | 115 | monospace_FontSpecFlag = iBit(3), /* can be used in preformatted content */ |
116 | allowSpacePunct_FontSpecFlag = iBit(4), /* space/punctuation glyphs from this auxiliary font can be used */ | 116 | auxiliary_FontSpecFlag = iBit(4), /* only used for looking up glyphs missing from other fonts */ |
117 | allowSpacePunct_FontSpecFlag = iBit(5), /* space/punctuation glyphs from this auxiliary font can be used */ | ||
117 | fixNunitoKerning_FontSpecFlag = iBit(31), /* manual hardcoded kerning tweaks for Nunito */ | 118 | fixNunitoKerning_FontSpecFlag = iBit(31), /* manual hardcoded kerning tweaks for Nunito */ |
118 | }; | 119 | }; |
119 | 120 | ||
120 | struct Impl_FontSpec { | 121 | struct Impl_FontSpec { |
121 | iString id; /* unique ID */ | 122 | iString id; /* unique ID */ |
122 | iString name; /* human-readable label */ | 123 | iString name; /* human-readable label */ |
123 | iString sourcePath; /* file where the path was loaded, could be a .fontpack */ | 124 | iString sourcePath; /* file where the path was loaded, could be a .fontpack */ |
124 | int flags; | 125 | int flags; |
125 | int priority; | 126 | int priority; |
126 | float heightScale[2]; /* overall height scaling; ui, document */ | 127 | float heightScale[2]; /* overall height scaling; ui, document */ |
127 | float glyphScale[2]; /* ui, document */ | 128 | float glyphScale[2]; /* ui, document */ |
128 | float vertOffsetScale[2]; /* ui, document */ | 129 | float vertOffsetScale[2]; /* ui, document */ |
129 | const iFontFile *styles[max_FontStyle]; | 130 | const iFontFile *styles[max_FontStyle]; |
130 | }; | 131 | }; |
131 | 132 | ||
@@ -158,25 +159,26 @@ iBool isDisabled_FontPack (const iFontPack *); | |||
158 | iBool isReadOnly_FontPack (const iFontPack *); | 159 | iBool isReadOnly_FontPack (const iFontPack *); |
159 | const iPtrArray * listSpecs_FontPack (const iFontPack *); | 160 | const iPtrArray * listSpecs_FontPack (const iFontPack *); |
160 | iString * infoText_FontPack (const iFontPack *); | 161 | iString * infoText_FontPack (const iFontPack *); |
161 | const iArray * actions_FontPack (const iFontPack *); | 162 | const iArray * actions_FontPack (const iFontPack *, iBool showInstalled); |
162 | 163 | ||
163 | const iString * idFromUrl_FontPack (const iString *url); | 164 | const iString * idFromUrl_FontPack (const iString *url); |
164 | 165 | ||
165 | /*----------------------------------------------------------------------------------------------*/ | 166 | /*----------------------------------------------------------------------------------------------*/ |
166 | 167 | ||
167 | iDeclareType(GmDocument) | ||
168 | |||
169 | void init_Fonts (const char *userDir); | 168 | void init_Fonts (const char *userDir); |
170 | void deinit_Fonts (void); | 169 | void deinit_Fonts (void); |
171 | 170 | ||
171 | void enablePack_Fonts (const iString *packId, iBool enable); | ||
172 | void updateActive_Fonts (void); | ||
172 | const iFontPack * pack_Fonts (const char *packId); | 173 | const iFontPack * pack_Fonts (const char *packId); |
173 | const iFontPack * packByPath_Fonts (const iString *path); | 174 | const iFontPack * packByPath_Fonts (const iString *path); |
174 | const iFontSpec * findSpec_Fonts (const char *fontId); | 175 | const iFontSpec * findSpec_Fonts (const char *fontId); |
175 | const iPtrArray * listPacks_Fonts (void); | 176 | const iPtrArray * listPacks_Fonts (void); |
176 | const iPtrArray * listSpecs_Fonts (iBool (*filterFunc)(const iFontSpec *)); | 177 | const iPtrArray * listSpecs_Fonts (iBool (*filterFunc)(const iFontSpec *)); |
177 | const iPtrArray * listSpecsByPriority_Fonts (void); | 178 | const iPtrArray * listSpecsByPriority_Fonts (void); |
178 | const iString * infoPage_Fonts (void); | 179 | const iString * infoPage_Fonts (iRangecc query); |
179 | void install_Fonts (const iString *fontId, const iBlock *data); | 180 | void install_Fonts (const iString *fontId, const iBlock *data); |
181 | void installFontFile_Fonts (const iString *fileName, const iBlock *data); | ||
180 | void reload_Fonts (void); | 182 | void reload_Fonts (void); |
181 | 183 | ||
182 | iLocalDef iBool isInstalled_Fonts(const char *packId) { | 184 | iLocalDef iBool isInstalled_Fonts(const char *packId) { |