Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

freetype rotation rendering bugfix #630

merged 1 commit into from Nov 23, 2018
Changes from all commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+2 −3
Diff settings


Just for now

@@ -63,7 +63,7 @@ set_node_key(NodeKey *key, GlyphIndex_t id, const FontRenderMode *mode)
KeyFields *fields = &key->fields;
const FT_UInt16 style_mask = ~(FT_STYLE_UNDERLINE);
const FT_UInt16 rflag_mask = ~(FT_RFLAG_VERTICAL | FT_RFLAG_KERNING);
unsigned short rot = (unsigned short)FX6_TRUNC(mode->rotation_angle);
unsigned short rot = (unsigned short)(((unsigned int)(mode->rotation_angle))>>16);

This comment has been minimized.

Copy link

dlon Nov 22, 2018


Might be cleaner or more consistent to use a macro? #define FX16_TRUNC(x) ((x) >> 16)

memset(key, 0, sizeof(*key));
fields->id = id;
@@ -610,8 +610,7 @@ _PGFT_LoadGlyph(FontGlyph *glyph, GlyphIndex_t id,
v_advance_rotated.x = 0;
v_advance_rotated.y = ft_metrics->vertAdvance + strong_delta.y;
if (rotation_angle != 0) {
FT_Angle counter_rotation = INT_TO_FX6(360) - rotation_angle;

FT_Angle counter_rotation = INT_TO_FX16(360) - rotation_angle;
FT_Vector_Rotate(&h_advance_rotated, rotation_angle);
FT_Vector_Rotate(&v_advance_rotated, counter_rotation);
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.