|
@@ -48,13 +48,13 @@ struct FontVariationAxis {
|
|
|
};
|
|
|
|
|
|
/// The scaling applied to font glyph coordinates when loading a glyph
|
|
|
-enum class FontCoordinateScaling {
|
|
|
- /// The incorrect legacy version that was in effect before version 1.12, coordinate values are divided by 64
|
|
|
- LEGACY,
|
|
|
+enum FontCoordinateScaling {
|
|
|
/// The coordinates are kept as the integer values native to the font file
|
|
|
- KEEP_INTEGERS,
|
|
|
+ FONT_SCALING_NONE,
|
|
|
/// The coordinates will be normalized to the em size, i.e. 1 = 1 em
|
|
|
- EM_NORMALIZED
|
|
|
+ FONT_SCALING_EM_NORMALIZED,
|
|
|
+ /// The incorrect legacy version that was in effect before version 1.12, coordinate values are divided by 64 - DO NOT USE - for backwards compatibility only
|
|
|
+ FONT_SCALING_LEGACY
|
|
|
};
|
|
|
|
|
|
/// Initializes the FreeType library.
|
|
@@ -76,9 +76,9 @@ FontHandle *loadFontData(FreetypeHandle *library, const byte *data, int length);
|
|
|
/// Unloads a font.
|
|
|
void destroyFont(FontHandle *font);
|
|
|
/// Outputs the metrics of a font.
|
|
|
-bool getFontMetrics(FontMetrics &metrics, FontHandle *font, FontCoordinateScaling coordinateScaling = FontCoordinateScaling::LEGACY);
|
|
|
+bool getFontMetrics(FontMetrics &metrics, FontHandle *font, FontCoordinateScaling coordinateScaling = FONT_SCALING_LEGACY);
|
|
|
/// Outputs the width of the space and tab characters.
|
|
|
-bool getFontWhitespaceWidth(double &spaceAdvance, double &tabAdvance, FontHandle *font, FontCoordinateScaling coordinateScaling = FontCoordinateScaling::LEGACY);
|
|
|
+bool getFontWhitespaceWidth(double &spaceAdvance, double &tabAdvance, FontHandle *font, FontCoordinateScaling coordinateScaling = FONT_SCALING_LEGACY);
|
|
|
/// Outputs the total number of glyphs available in the font.
|
|
|
bool getGlyphCount(unsigned &output, FontHandle *font);
|
|
|
/// Outputs the glyph index corresponding to the specified Unicode character.
|
|
@@ -90,8 +90,8 @@ bool loadGlyph(Shape &output, FontHandle *font, unicode_t unicode, FontCoordinat
|
|
|
bool loadGlyph(Shape &output, FontHandle *font, GlyphIndex glyphIndex, double *outAdvance = NULL);
|
|
|
bool loadGlyph(Shape &output, FontHandle *font, unicode_t unicode, double *outAdvance = NULL);
|
|
|
/// Outputs the kerning distance adjustment between two specific glyphs.
|
|
|
-bool getKerning(double &output, FontHandle *font, GlyphIndex glyphIndex0, GlyphIndex glyphIndex1, FontCoordinateScaling coordinateScaling = FontCoordinateScaling::LEGACY);
|
|
|
-bool getKerning(double &output, FontHandle *font, unicode_t unicode0, unicode_t unicode1, FontCoordinateScaling coordinateScaling = FontCoordinateScaling::LEGACY);
|
|
|
+bool getKerning(double &output, FontHandle *font, GlyphIndex glyphIndex0, GlyphIndex glyphIndex1, FontCoordinateScaling coordinateScaling = FONT_SCALING_LEGACY);
|
|
|
+bool getKerning(double &output, FontHandle *font, unicode_t unicode0, unicode_t unicode1, FontCoordinateScaling coordinateScaling = FONT_SCALING_LEGACY);
|
|
|
|
|
|
#ifndef MSDFGEN_DISABLE_VARIABLE_FONTS
|
|
|
/// Sets a single variation axis of a variable font.
|