Jump to content

GDIPlus: how to define the style of a font with multiple files


Recommended Posts

How can you select the specific style of a font with multiple * .otf files?

The font in question has several files:


  • Thin
  • Thin Italic
  • Extra-Light
  • Extra-Light Italic
  • Light
  • Light Italic
  • Regular
  • Regular Italic
  • Medium
  • Medium Italic
  • Semi-Bold
  • Semi-Bold Italic
  • Bold
  • Bold Italic
  • Extra-Bold
  • Extra-Bold Italic
  • Black
  • Black Italic

But after doing several tests I can recall the font like this, without being able to specify the precise style:

Local $hFamily = _GDIPlus_FontFamilyCreate("Poppins") ; 
Local $hFont = _GDIPlus_FontCreate($hFamily, 95, 1+2, 3) ;

Example I cannot therefore select "Poppins Black Italic"

but only "Poppins

Thank you

2020-01-24 (1).png

Link to comment
Share on other sites

This works for me, seem you have to take the font name from the font-file (I use IrfanView to take a look at the font properties).

Local $hFamily = _GDIPlus_FontFamilyCreate("Poppins Black")
Local $hFont = _GDIPlus_FontCreate($hFamily, 45, 1+2, 3) ;


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...