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

Author Topic: Bitmap fonts (again)  (Read 5837 times)

0 Members and 1 Guest are viewing this topic.

wegas

  • Newbie
  • *
  • Posts: 1
    • View Profile
Bitmap fonts (again)
« on: April 23, 2014, 01:45:09 am »
Hello forums,

I want to use bitmap fonts within SFML. As I've read here and there on the forums that this seems easily possible, I hope for inclusion into SFML. If it does not make sense to include into SFML, I would be happy for external source code that could be easily implemented.

Thank you

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Bitmap fonts (again)
« Reply #1 on: April 24, 2014, 01:22:47 am »
It's certainly something, we'll be discussing, however there are many open issues that have a higher priority right now. :)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
Re: Bitmap fonts (again)
« Reply #2 on: April 25, 2014, 09:14:00 am »
If this can be done without breaking the API, then it might be interesting for a 2.x release. However I'm not yet familiar enough with sf::Font and its connection to freetype to make any assumptions.

Deathbeam

  • Jr. Member
  • **
  • Posts: 82
  • VB6, VB.NET, C#, HTML, PHP, CSS, JavaScript nerd.
    • View Profile
    • My portfolio
    • Email
Re: Bitmap fonts (again)
« Reply #3 on: April 28, 2014, 04:16:31 pm »
I totally agree with adding spritefonts, sometimes they are better than normal fonts and most of times they are alot faster.
Spooker Framework - Open source gaming library
My portfolio
Indie Armory - Small community of a game developers. Everyone is welcome. Bring your friends, family, pets...

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Bitmap fonts (again)
« Reply #4 on: April 28, 2014, 04:50:15 pm »
The main problem with bitmap fonts is that SFML would need to define its own font file format (or pick a standard one, if any), that defines:
- the position and size of glyph sprites in the font texture
- the font metrics (line spacing, ...)
- the various glyphs' metrics (advance, kernel, ...)

Another solution would be to provide an empty shell, with various setters that would be called by the user to populate all the bitmap font's attributes. But then what's the point of a bitmap font class?
Laurent Gomila - SFML developer

Deathbeam

  • Jr. Member
  • **
  • Posts: 82
  • VB6, VB.NET, C#, HTML, PHP, CSS, JavaScript nerd.
    • View Profile
    • My portfolio
    • Email
Re: Bitmap fonts (again)
« Reply #5 on: April 28, 2014, 05:00:58 pm »
The main problem with bitmap fonts is that SFML would need to define its own font file format (or pick a standard one, if any), that defines:
- the position and size of glyph sprites in the font texture
- the font metrics (line spacing, ...)
- the various glyphs' metrics (advance, kernel, ...)

Another solution would be to provide an empty shell, with various setters that would be called by the user to populate all the bitmap font's attributes. But then what's the point of a bitmap font class?

Here is format example what I was using in my Visual Basic 6 DX8 engine (yep, I am old-school :D )
http://www.codehead.co.uk/cbfg/. Try to make font in it (you should set cell sizes to 16 for all characters) and export .BMP and .DAT and then simply convert .BMP to png and remove background. That was format what I was using and it worked perfectly.
Spooker Framework - Open source gaming library
My portfolio
Indie Armory - Small community of a game developers. Everyone is welcome. Bring your friends, family, pets...

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Bitmap fonts (again)
« Reply #6 on: April 28, 2014, 07:10:03 pm »
There's not much information to store, so any format would work well. This is not the problem. The problem is to find one which is standard, and as far as I know there's none.
Laurent Gomila - SFML developer

Deathbeam

  • Jr. Member
  • **
  • Posts: 82
  • VB6, VB.NET, C#, HTML, PHP, CSS, JavaScript nerd.
    • View Profile
    • My portfolio
    • Email
Re: Bitmap fonts (again)
« Reply #7 on: April 28, 2014, 07:54:20 pm »
There's not much information to store, so any format would work well. This is not the problem. The problem is to find one which is standard, and as far as I know there's none.
Format what uses that program is more-less standard. Atleast in every engine what I used before there was that format. I do not know how XNA handles bitmap font (neither I care), but I think this format is standard one.
Spooker Framework - Open source gaming library
My portfolio
Indie Armory - Small community of a game developers. Everyone is welcome. Bring your friends, family, pets...

NoobsArePeople2

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Email
Re: Bitmap fonts (again)
« Reply #8 on: April 30, 2014, 12:23:47 am »
The problem is to find one which is standard, and as far as I know there's none.

I think the best you're gonna get is a defacto standard.

The two other frameworks I have experience with, Moai and Cocos2D, both use BMFont. I believe it covers all your requirements (features are listed on the site).

 

anything