Code::Blocks Forums

User forums => Help => Topic started by: Piotr Grochowski on April 30, 2020, 07:09:30 pm

Title: Incorrect font height in some fonts
Post by: Piotr Grochowski on April 30, 2020, 07:09:30 pm
This is in Microsoft Windows.

[img src=https://i.imgur.com/BNdG29O.png /]

On the left is code blocks, where the font height is one pixel too much. On the right is Microsoft Notepad where the font height is handled properly.

An important thing is that it only happens with some fonts, not all fonts. This applies to both bitmap and TrueType fonts. My theory is that the incorrect font height happens when the font bottom is on the baseline (like is the case in the picture). This is not the right behavior of GDI rendering. I hate being prevented from using certain fonts as intended so please fix this issue by the next version.
Title: Re: Incorrect font height in some fonts
Post by: Piotr Grochowski on April 30, 2020, 07:38:26 pm
And yes I did update to 20.03 and it's clearly not fixed, same result!
Title: Re: Incorrect font height in some fonts
Post by: oBFusCATed on April 30, 2020, 07:41:16 pm
If you want to get help you'll need to provide more details, like:

1. Which fonts work?
2. Which doesn't?
3. What happens if you change the font size?
4. Does it work correctly in scite or codelite? Or even the stc demo in wxwidgets?
4. OS version
5. Have you tried to enable direct 2d in 20.03 ( settings -> editor -> other editor settings -> technology)?
Title: Re: Incorrect font height in some fonts
Post by: Piotr Grochowski on April 30, 2020, 07:52:48 pm
If you want to get help you'll need to provide more details, like:

1. Which fonts work?
2. Which doesn't?
3. What happens if you change the font size?
4. Does it work correctly in scite or codelite? Or even the stc demo in wxwidgets?
4. OS version
5. Have you tried to enable direct 2d in 20.03 ( settings -> editor -> other editor settings -> technology)?

1. Ones that have space both below and above the baseline (they are internal font settings, also called WinAscent and WinDescent)
2. Ones that have the baseline at the font bottom
3. The font height gets consistently off-by-one
4. I haven't learned the entirety of the C++ language yet so I don't know about those features.
4. Windows 10 Home, 1909, 18363.778
5. There isn't a "direct 2d" option anywhere
Title: Re: Incorrect font height in some fonts
Post by: Piotr Grochowski on May 26, 2020, 09:19:56 am
Reproducible too in Windows 7 Ultimate x64 Edition.
Title: Re: Incorrect font height in some fonts
Post by: BlueHazzard on May 26, 2020, 08:08:25 pm
Have you tried the latest release? Have you tried the option from
Quote
5. Have you tried to enable direct 2d in 20.03 ( settings -> editor -> other editor settings -> technology)?

Have you tried your font in notepad++? is it the same problem?

Can you name a font? Does it happen with windows standard fonts, or do i have to download a font?
Title: Re: Incorrect font height in some fonts
Post by: Piotr Grochowski on June 01, 2020, 08:27:15 am
Have you tried the latest release? Have you tried the option from
Quote
5. Have you tried to enable direct 2d in 20.03 ( settings -> editor -> other editor settings -> technology)?

Have you tried your font in notepad++? is it the same problem?

Can you name a font? Does it happen with windows standard fonts, or do i have to download a font?

I do not have Notepad++ right now and do not intend to ever use it.

Fonts that show the Incorrect font height in some fonts glitch include: Riglos Mono (https://typedesign.netlify.app/riglos.html) (as of version 1.1, not 1.0), and TD bitmaps (https://typedesign.netlify.app/tdbitmaps.html) fonts. The way to test the fonts for font height is to use this character: █ and paste it along multiple rows.