TTT-2 / TTT2

Trouble in Terrorist Town 2 for Garry's Mod (gmod)
https://steamcommunity.com/sharedfiles/filedetails/?id=1357204556
179 stars 78 forks source link

Fonts: Rework #1402

Open TimGoll opened 9 months ago

TimGoll commented 9 months ago

This is an issue with multiple things that should be changed for fonts. This can happen over multiple PRs

Idea: Don't pregenerate advanced fonts for 1.0, 1.5 and 2.0 scale but generate the fitting font on scale change. So if you set the scale to 1.3, all fonts are regenerated to use that scale. We might have to support the old system still, because some addons might use it

EntranceJew commented 9 months ago

the main thing is that we generate a font starting from the global scale, so that the initial font selected is not stretched, like on 1.7: gmod_vN624aaBSH vs 2.0 (applied same-session): gmod_CP4fU1NVzu vs 2.0 (applied after a map restart): gmod_UrerlAPqGn

and for the "breakpoint" font sizes to correspond with a multiple of the initial font size, e.g. 1.7, 2.55, 3.4, 4.25 and we use those scales when the requested font scale is 1, 1.5, 2.0, 2.5 so that they're crisp as well

internally, i believe nearly all the font scale calls are using one of the preset breakpoints

TimGoll commented 9 months ago

internally, i believe nearly all the font scale calls are using one of the preset breakpoints

internally we only use the 1.0 scale, or the scale defined with the slider. We never increase a font by using a scale factor. So if we were to recreate fonts on scale change, we only would need a single font

EntranceJew commented 9 months ago

TTT2_OS_SC_SB.zip also here's the font i edited the name to if we wanted to use Open Sans SemiCondensed SemiBold across the board, i renamed it to TTT2_OS_SC_SB and that's what the CreateFont declaration should call it as well