Commit graph

21 commits

Author SHA1 Message Date
Robert Müller d642abd722 Add font index, support font family variants depending on language
Add `fonts/index.json` which specifies:

- List of all font files that should be loaded (filenames).
- Default font (specified by family name or by family and style name).
- Font variants for different languages, using the name of the language file as key.
- Fallback fonts.
- Icon font.

There are characters (e.g. all in `刃直海角骨入`) that look different depending on the language of the content being Japanese, Simplified Chinese, Traditional Chinese and Hangul, because Unicode uses the same codepoint for characters regardless of the language. To render these characters correctly, the active variant font is switched depending on the selected language.

The `ITextRender` interface is changed so the current language variant can be set using `SetFontLanguageVariant` and the default and icon fonts can be toggled using `SetFontPreset`. The class `CFont` is removed entirely.

The text render is restructured: The font faces and font atlas are now managed by a separate class `CGlyphMap` like on upstream. As the text fill and outline textures always have the same size, the texture skyline only needs to be stored once and free positions in the atlas only need to be calculated once for each glyph instead of separately for the fill and outline textures.

The font files and their licenses are also updated:

- Update Source Han Sans to version 2.001.
- Update Glow Sans Japanese Compressed to version 0.93.
- Update Deja Vu Sans to version 2.37.
- Update Font Awesome icons font to March 2023 version.

Closes #6881.
2023-08-01 19:30:25 +02:00
VoxelDoesCode a1617dcf56 Replace all images with unicode chars 2022-08-17 03:58:13 -04:00
Jupeyy 18d85fda0d Update icons font 2022-03-19 18:35:37 +01:00
Freddie Wang 66caa896b9 Add japanese condensed font 2021-06-04 21:15:29 +08:00
def 178d864ec9 Switch to Source Han Sans font 2020-08-20 13:55:03 +02:00
def 446526486d Use two fonts, one as explicit fallback
Merging with fontforge had problems, for example for the Bei (U+5317) in
Beijing, see https://github.com/fontforge/fontforge/issues/4432
2020-08-20 11:13:08 +02:00
def 1394ac0fc4 Merge DejaVuSansCJKName with DejavuWenQuanYiMicroHei and use it for all (fixes #2593)
got them merged with fontforge, finally looks good.

allows reading CJK for everyone independent of language chosen.

Hopefully the lags are gone.
2020-08-19 12:31:55 +02:00
Jupeyy e642b14c88 add icon font 2018-03-13 21:43:27 +01:00
Tom 96510284e3 Add font support for chinese, japanese, korean.
Added some character to DejaVuSans Font, so Language List can show CJK names.
Modify code to let ddnet choose DejavuWenQuanYiMicroHei when user choose CJK language, this font is merge from Dejavu and WenQuanYiMicroHei.
2016-02-06 00:13:57 +08:00
def c9e0f7e950 Remove unusued fonts 2015-04-17 20:09:37 +02:00
GreYFoX 1446d0980b Merge branch 'master' of git://github.com/oy/teeworlds into DDRace
* Version 1.098a
Conflicts:
	bam.lua
	src/game/client/gameclient.h
	src/game/mapitems.h
2011-12-05 11:32:01 +02:00
oy 318d4e24b0 updated dejavu font to 2.33 2011-12-04 19:50:43 +01:00
GreYFoXGTi d6b898c84a Merge branch 'master' of http://github.com/oy/teeworlds 2010-10-30 00:48:17 +02:00
oy 476f951ffc added font that provides more characters. closes #56 2010-10-29 23:44:08 +02:00
GreYFoXGTi 7f8fb7a5a7 Merging the client manually into the server
but i can't get the client to accept the console class of the server -.-" yet..

Signed-off-by: GreYFoXGTi <GreYFoXGTi@GMaiL.CoM>
2010-08-25 17:31:49 +02:00
Magnus Auvinen cdc5f26900 new font rendering system using freetype2. only compiles under linux for now 2009-06-07 14:36:54 +00:00
Jakob Fries 32338b68f3 Further cleanup 2008-01-19 16:49:57 +00:00
Jakob Fries 4edf650a50 font cleanup 2008-01-19 16:49:24 +00:00
Jakob Fries 38aacd5dbb Moved fonts to data dir 2008-01-19 16:44:02 +00:00
Magnus Auvinen f826bc6cac larger update. reduced the amount of video memory used from ~60 to ~36mb on a typical map 2007-07-30 19:46:31 +00:00
Magnus Auvinen 73aa9b71c1 started the major restructure of svn 2007-05-22 15:03:32 +00:00