Author Topic: TrueType font rendering  (Read 46376 times)

0 Members and 1 Guest are viewing this topic.

Offline m!m

  • 211
Re: TrueType font rendering
I though about it some more and I don't think we actually need such an option. The height is a property of the font that has a good reason for being exactly what it is and if the line height of a font should be less then the font needs to change and not the rendering engine.

 

Offline Yarn

  • 210
Re: TrueType font rendering
I think you're misunderstanding me. I was actually trying to say that messing with the line height is not a good way to fix the text positioning. I'm not suggesting having an option to reduce the line height; rather, I'm suggesting having a way to move the text up slightly while keeping the line height the same. Achieving this shouldn't require reducing the line height.
"Your fighter is running out of oil.  Please check under the hood and add more if necessary"
--strings.tbl, entry 177

"Freespace is very tired.  It is shutting down to get some rest."
--strings.tbl, entry 178

 

Offline m!m

  • 211
Re: TrueType font rendering
I do understand that but I really dislike the idea of adding an option to fix an issue that should be fixed by the font itself and not the renderer. There are already a lot of fixes to make the code work with retail and I don't want to introduce more code paths for something that is a problem of the font.

 

Offline Yarn

  • 210
Re: TrueType font rendering
So you're saying that there's a way to edit a font to make it be rendered at a slightly higher position without reducing the amount of space given for accents? If so, how can it be done?
"Your fighter is running out of oil.  Please check under the hood and add more if necessary"
--strings.tbl, entry 177

"Freespace is very tired.  It is shutting down to get some rest."
--strings.tbl, entry 178

 

Offline m!m

  • 211
Re: TrueType font rendering
I have no idea how to edit a TrueType font but having a font where an accented character isn't taller than a capital character should work fine as the maximum line height is the height of a capital letter and not the height of the accented character.

 

Offline jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
Re: TrueType font rendering
http://fontforge.github.io/en-US/

These folks look decent.

 

Offline Yarn

  • 210
Re: TrueType font rendering
Your belief that "the maximum line height is the height of a capital letter and not the height of the accented character" is incorrect. Why? Because capital letters can take accents too, and accented capital letters are even taller than regular capital letters. Also, accented lowercase letters can be taller than capital letters. Add to that the existence of letters with underhangs (e.g., the lowercase letters g and j), accents below letters (e.g., the French letter Ç), and the possibility of multiple rows of accents (as in Vietnamese), and you can see that a font's line height definitely needs to be greater than the height of a regular capital letter (and most fonts, including BankGothic, take this stuff into account).

While it's technically possible to make accented letters no taller than regular capital letters, it's far from ideal. Sure, the default VF font of the localized versions manages to do this, but only by doing things like squashing the letter or shifting the letter down slightly (made possible by the two extra pixels of space below the letters), so it doesn't look all that great.

If you want to see what all the characters look like, check this out: https://www.dropbox.com/s/3iwoymnmwpg9ydu/fs_font_chars.zip?dl=1. It contains a PNG of every character from every font of every version FS1 and FS2 that I could obtain, with duplicate font files omitted.

tl;dr: The issue at hand isn't something that can properly fixed by modifying the font. Requiring modders to reduce the height of accented characters just to fix the text positioning isn't a good idea because that would make such characters look unnecessarily worse than they should.
« Last Edit: September 15, 2017, 12:22:40 am by Yarn »
"Your fighter is running out of oil.  Please check under the hood and add more if necessary"
--strings.tbl, entry 177

"Freespace is very tired.  It is shutting down to get some rest."
--strings.tbl, entry 178

 

Offline m!m

  • 211
Sorry for the delay, I'm a bit busy right now...

I understand that changing the fonts is far from an ideal solution but all this discussion boils down to the fact that the current interface is just not designed for special characters and changing that is out of the scope of this project.
Should the interface be overhauled at some point those considerations can be used to design a better UI that can be used with all languages.

 

Offline Yarn

  • 210
I've been thinking about this some more. It turns out that this issue isn't really specific to TrueType fonts; it also affects taller VF fonts. Thus, it's probably better after all to fix this issue separately from this project. (And I think I can fix this in a way that doesn't require table edits, at least for text whose Y-positions are hard-coded and cannot be changed.)

With that out of the way, I think this branch is about ready to be merged.
"Your fighter is running out of oil.  Please check under the hood and add more if necessary"
--strings.tbl, entry 177

"Freespace is very tired.  It is shutting down to get some rest."
--strings.tbl, entry 178

 

Offline Bryan See

  • Has anyone really been far as decided to use even go want to do look more like?
  • 210
  • Trying to redeem, but under Tiger Parents
    • Skype
    • Steam
    • Twitter
Re: TrueType font rendering
Yarn, has this branch merged into master of the git branch?
Bryan See - My FreeSpace Wiki User Page (Talk, Contributions)

Full Projects:
Shattered Stars

Campaigns:
Lost in the Mist - Cyrene vs. Psamtik
FreeSpace: Reunited

Ships:
GTS Hygeia, GTT Argo, SC Raguel

Tools:
FSO TC/Game template

I've been under attack by Tiger Parents like Jennifer Pan...

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: TrueType font rendering
No.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline m!m

  • 211
Re: TrueType font rendering
After five years, this has finally been merged into master!

The changes will appear in the next nightly build and I'll update the wiki ASAP.

EDIT: Wiki has been updated.
« Last Edit: August 02, 2016, 12:08:03 pm by m!m »

 

Offline Bryan See

  • Has anyone really been far as decided to use even go want to do look more like?
  • 210
  • Trying to redeem, but under Tiger Parents
    • Skype
    • Steam
    • Twitter
Re: TrueType font rendering
Looking forward to it :)

Anyway, what about the font limits, which is currently set to 5? Will these be bumped to higher numbers or infinite?
Bryan See - My FreeSpace Wiki User Page (Talk, Contributions)

Full Projects:
Shattered Stars

Campaigns:
Lost in the Mist - Cyrene vs. Psamtik
FreeSpace: Reunited

Ships:
GTS Hygeia, GTT Argo, SC Raguel

Tools:
FSO TC/Game template

I've been under attack by Tiger Parents like Jennifer Pan...

 

Offline m!m

  • 211
Re: TrueType font rendering
Quote from: FreeSpace wiki
The number of possible fonts is unlimited.

 

Offline Axem

  • 211
Re: TrueType font rendering
*Axem feverishly readies his Comic Sans MS font files

 

Offline m!m

  • 211
Re: TrueType font rendering
:banghead: I forgot to add the Comic Sans assertion!

 
I would like to confirm just in case. this support don't mean i18n support. ok?
if it is so, i must be told this again after 5 years ...
I mentioned several times. japanese translation is almost finished 10 years ago. but we still don't have i18n support on the game...
« Last Edit: September 08, 2016, 06:06:55 am by Arkblade »

 

Offline m!m

  • 211
No, this does not mean that we have i18n support but at least the rendering engine will be able to display those characters once that gets implemented.

 
Just had a thought. Does support for TrueType fonts also mean OpenType fonts will work too?
There are only 10 kinds of people in the world;
those who understand binary and those who don't.

 

Offline m!m

  • 211
I don't think so but you could always try it.