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

Multilingual font rendering #1993

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Multilingual font rendering #1993

wants to merge 13 commits into from

Conversation

YuanBaian
Copy link

put your ttf file into "3rdparty\extras\xash-extras\gfx\fonts"
Change "cl_font.c" file (FONT_COUNT, g_FontsPath, g_FontsSize) to add your ttf font


Q_snprintf( texname, sizeof( texname ), "font_%i", Font_GetTexIndex(self, ch));

if (!(id = ref.dllFuncs.GL_FindTexture(texname)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something that would be really nice to have, before this gets merged, is to load the characters in the atlas texture, like mainui_cpp, to eliminate texture switching.

Maybe allocate 1024x1024 texture and fill it with characters as needed, and once it gets filled up, allocate another large texture.

And then cache the result, something I did in mainui_cpp because drawing glyphs takes a lot of time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants