c++ - DirectWrite text position different by font size -
i'm using directwrite render text window. seems work except positioning when using different font sizes: i'd expect 2 texts font size v1 , v2 , both (x, y) = (0, 0) @ top left can see:
neither "test" nor "x" @ top left.
is there way make work?
welcome world of fonts. fonts difficult thing use, because there surprises in font ( there many new standards supposed solves , confuse more because no font support @ 100%, 'classic' font have partial/bad information in them) gdi, gdi+, directdraw don't draw font @ same position in pixels because of math, coordinate rounding, anti-aliasing... ( can have 1 more bonus if math freetype ).
when try print font there other pb. way around me. don't try draw font @ pixel coordinates. job @ drawing font, picture, lines on screen render well, best convert them printing coordinate exports never expect control pixel in fonts, round approximates.
ps : don't trust internal fields in fonts. on arial on other fonts missing or initialised zero, "fun" part it's not same field not present depends of fonts. use fields if try them before font. yes fonts fantastic!
Comments
Post a Comment