MCPcopy Create free account
hub / github.com/MyGUI/mygui / readFreetypeOutline

Function readFreetypeOutline

MyGUIEngine/src/msdfgen/ext/import-font.cpp:144–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142}
143
144FT_Error readFreetypeOutline(Shape &output, FT_Outline *outline, double scale) {
145 output.contours.clear();
146 output.setYAxisOrientation(Y_UPWARD);
147 FtContext context = { };
148 context.scale = scale;
149 context.shape = &output;
150 FT_Outline_Funcs ftFunctions;
151 ftFunctions.move_to = &ftMoveTo;
152 ftFunctions.line_to = &ftLineTo;
153 ftFunctions.conic_to = &ftConicTo;
154 ftFunctions.cubic_to = &ftCubicTo;
155 ftFunctions.shift = 0;
156 ftFunctions.delta = 0;
157 FT_Error error = FT_Outline_Decompose(outline, &ftFunctions, &context);
158 if (!output.contours.empty() && output.contours.back().edges.empty())
159 output.contours.pop_back();
160 return error;
161}
162
163FontHandle *loadFont(FreetypeHandle *library, const char *filename) {
164 if (!library)

Callers 1

loadGlyphFunction · 0.85

Calls 3

setYAxisOrientationMethod · 0.80
clearMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected