How to draw font in bold and italic by freetype

I have typed unicode text into my program using FTGL. I want to include italic and bold options.

How can i do this?

How do I know if a font file is in italics?

Is there an italic or bold option in the font file?

Is it possible to just check the font name like this:

arial- oblique .ttf

With arial unicode ms and the other I am setting a flag but it doesn't work

face->style_flags = FT_STYLE_FLAG_ITALIC;

      

How can I control it?

I read the article on the freetype homepage but still I don't know.

+3


source to share


1 answer


You need an actual ttf or otf file to represent italic, bold and strikethrough ect. Arial actually consists of several files, as well as most of the fonts for each style. To render italicized in FreeType, simply pass the ariali.ttf file to FT_New_Face and you will be able to italicize. It would be a good idea to create a FontManager that manages fonts and fonts so that you can create multiple types of fonts with different styles and sizes without having to re-create them. Hope this helps!



+2


source







All Articles