| 142 | } |
| 143 | |
| 144 | FT_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 | |
| 163 | FontHandle *loadFont(FreetypeHandle *library, const char *filename) { |
| 164 | if (!library) |
no test coverage detected