asusralis
Topic Author
Posts: 56
Joined: 30 Jul 2018, 05:03

Two questions about fonts and text.

20 Jan 2019, 23:59

1): It seems like, no matter what font I use, there is always extra space at the top. You can see it here and here. It looks the same way in Blend. The default Noesis seems to actually be centered: https://i.imgur.com/A2gjuwm.png
https://i.imgur.com/bMxwIsu.png. Are all the fonts I'm using just not made correctly? Am I missing to set a certain property?

2): I'm trying to create a font file so I can use bold text, but it doesn't seem to work. I'm following this post because I can't find it anywhere in the documents that actually shows how to create a font file despite the post saying it's in documents.

I made a file called ManropeFamily.font, put this in it:
manrope-regular.otf
manrope-bold.otf

My project explorer looks like this: https://i.imgur.com/PEX51hr.png

And I'm loading it like this:
<Setter Property="FontFamily" Value="/Assets/Project/Media/Fonts/#ManropeFamily"/>

What am I doing wrong?

Tags:
 
asusralis
Topic Author
Posts: 56
Joined: 30 Jul 2018, 05:03

Re: Two questions about fonts and text.

21 Jan 2019, 00:28

It seems I fixed #2 by pointing the fontfamily source to just Manrope? How the heck does it find the font file if it's called ManropeFamily?
 
User avatar
jsantos
Site Admin
Posts: 2588
Joined: 20 Jan 2012, 17:18
Contact:

Re: Two questions about fonts and text.

21 Jan 2019, 15:06

#1

First, let me point out that only in Noesis 2.2.X we render fonts identically to Blend. In previous versions we followed a different algorithm. Having said that, if you are creating the font yourself you need to take care to the ascender, descender and linegap metrics. They are in the OS2 table, if the flag USE_TYPO_METRICS is activated we use sTypoAscender, sTypoDescender and sTypoLineGap. If the flag is not set we use usWinAscent and usWinDescent.
 
User avatar
jsantos
Site Admin
Posts: 2588
Joined: 20 Jan 2012, 17:18
Contact:

Re: Two questions about fonts and text.

21 Jan 2019, 15:06

It seems I fixed #2 by pointing the fontfamily source to just Manrope? How the heck does it find the font file if it's called ManropeFamily?
The name of the file doesn't matter at all. We just scan the TTFs looking for the font family. That's the same behavior in WPF.

Who is online

Users browsing this forum: Google [Bot] and 3 guests