Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fonts: Rework #1402

Open
TimGoll opened this issue Feb 9, 2024 · 3 comments
Open

Fonts: Rework #1402

TimGoll opened this issue Feb 9, 2024 · 3 comments
Labels
type/enhancement Enhancement or simple change to existing functionality

Comments

@TimGoll
Copy link
Member

TimGoll commented Feb 9, 2024

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

  • Switch from Tahoma to a different font that is distributed with TTT2. Currently OpenSans seems like a good canidate
  • Move all font creation to a single file, that way we might be able to remove some duplicates
  • Re-/Create fonts in TTT2FinishedLoading so that our advanced font system is hotreload safe

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

@TimGoll TimGoll modified the milestones: v0.13.xb, v0.14.0b Feb 9, 2024
@TimGoll TimGoll added type/enhancement Enhancement or simple change to existing functionality keepalive labels Feb 9, 2024
@EntranceJew
Copy link
Contributor

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
Copy link
Member Author

TimGoll commented Feb 9, 2024

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
Copy link
Contributor

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

@Histalek Histalek modified the milestones: v0.14.0b, Feature Backlog Mar 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Enhancement or simple change to existing functionality
Projects
None yet
Development

No branches or pull requests

3 participants