Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Regular and bold font (2 files?)  (Read 1856 times)

0 Members and 1 Guest are viewing this topic.

Tenry

  • Full Member
  • ***
  • Posts: 120
  • Experienced Programmer
    • View Profile
    • Simon-Burchert.com
Regular and bold font (2 files?)
« on: September 29, 2013, 02:36:32 pm »
I am wondering why I have for most of my default fonts more than 1 file (for example "arial.ttf" and "arialbd.ttf"). I can see that the first one includes the default one and the second the bold one... but how does it work with SFML's setStyle() function? I mean, when loading a font, I specify only one file (propably arial.ttf), how can this become bold? It will propably don't look for a different file than, so does it a kind of to-bold conversion itself? What would happen, if I choose "arialbd.ttf" as the file and the regular style?
Please note that my previous display name was "Shy Guy".

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11033
    • View Profile
    • development blog
    • Email
AW: Regular and bold font (2 files?)
« Reply #1 on: September 29, 2013, 03:14:33 pm »
SFML/freetype simply stretches the font as far as I know, thus it's more or less simulating boldness. If you want the true boldness of the given font, you'll have to load both fonts and switch in between.
For example in Photoshop you'll only get bold/italic if there's another font file, otherwise you'll have to switch to the text settings and add "artificial" boldness.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Tenry

  • Full Member
  • ***
  • Posts: 120
  • Experienced Programmer
    • View Profile
    • Simon-Burchert.com
Re: AW: Regular and bold font (2 files?)
« Reply #2 on: September 29, 2013, 03:42:54 pm »
SFML/freetype simply stretches the font as far as I know, thus it's more or less simulating boldness. If you want the true boldness of the given font, you'll have to load both fonts and switch in between.
For example in Photoshop you'll only get bold/italic if there's another font file, otherwise you'll have to switch to the text settings and add "artificial" boldness.
Ah, okay. Thank you very much for clarification! :)
Please note that my previous display name was "Shy Guy".