Skip to content

[coretext] make setting font gravity work

Khaled Hosny requested to merge coretext-gravity into master

Setting font gravity to anything other than PANGO_GRAVITY_SOUTH causes no fonts to be matched on Core Text backend because the code for finding best match checks for equal gravity between the requested font and the fonts in the font set, and the later always have PANGO_GRAVITY_SOUTH. Hack around this by copying the gravity from the requested font.

Can be tested with:

$ pango-view --gravity=east --rotate=-90 utils/test-chinese.txt

Currently without this change it gives:

(pango-view:2824): Pango-WARNING **: 10:59:18.683: couldn't load font "serif Rotated-Left 12", modified variant/weight/stretch as fallback, expect ugly output.

(pango-view:2824): Pango-ERROR **: 10:59:18.683: Could not load fallback font, bailing out.
Trace/BPT trap: 5

Merge request reports