Thread Tools Display Modes
12/21/23, 05:47 PM   #1
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,578
Upcoming changes to font rendering in Update 41

I figured since no English thread about the topic existed yet, I'd make one to collect all the info we know so far.

In Update 41 all font rendering will be switched to a new system, which means any addons that contains custom fonts will need to convert them to a new format.
The Demo section on https://sluglibrary.com/ provides a demo program as well as some instructions on how to convert .ttf and .otf files into .slug files in order to test them.

Originally Posted by ZOS_DanBatson
Heads up: Coming in 41 will be a change to the way we do fonts. We're going to be switching to Slug. This won't impact most add-ons, but any add-ons that provide their own fonts will need to do an update. We'll be providing the tool to generate Slug files with the patcher and once things are more finalized I'll provide a walkthrough on esoui.com. In theory, it should just involve taking whatever font you were using, running it through the tool, and using the generated slug file instead. More details to come, hopefully soon. https://sluglibrary.com/
(link to original message)

Originally Posted by ZOS_DanBatson
If you try to set a ttf or otf font, we will not use it and instead fall back to one of our vanilla fonts. Slug will be the only text renderer and it only works with slug files. We might have a mechanism that says "they said ttf, let's see if we can find something of the same name but .slug instead" but I'm not certain about that. But we definitely will not support actual ttf or otf files any longer, they simply will not work.
FreeType will be gone from the code. Only Slug will remain
(link to original message)

From the PTS Patch Notes:
The game now uses a new UI font rendering system. This allows for future improvements to the game and provides small enhancements in some specific situations, such as nameplates and chat bubbles.

Addon creators can find a new tool, slugfont.exe, in the game directory that allows them to update their use of custom fonts to be compatible with the new system. Addons that make use of custom fonts will instead use default fonts until they receive an update, and fonts included with the game will continue to work without requiring an update. Instructions are provided in slugfont_readme.txt.

Last edited by sirinsidiator : 01/29/24 at 01:58 PM.
  Reply With Quote
12/23/23, 05:00 AM   #2
FlatBadger
 
FlatBadger's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2021
Posts: 17
I don't use custom fonts personally, but I do have a few addons that use explicit font paths, so the feature of "they said ttf, let's see if we can find something of the same name but .slug instead" would be useful I think. That being said, I could just correct the paths in my code
  Reply With Quote
01/29/24, 04:40 PM   #3
DakJaniels
AddOn Author - Click to view addons
Join Date: Mar 2021
Posts: 31
batch convert fonts

If the tool is the same as the one from the demo, you can use this in a .bat to convert all .ttf & .otf files in the folder as the slugfont.exe

Code:
@echo off
for %%i in (*.ttf, *.otf) do (
    .\slugfont.exe "%%i" -o "%%~ni.slug"
)
might be useful for someone.
  Reply With Quote
01/29/24, 10:13 PM   #4
Sharlikran
 
Sharlikran's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 655
Process all mod folders
Code:
@echo off
setlocal enabledelayedexpansion

echo Processing fonts...

for /d /r %%F in (*) do (
    set "parentFolder=%%F"
    set "parentFolder=!parentFolder:%CD%\=!"
    echo Searching in folder: "!parentFolder!"
    for %%i in ("%%F\*.ttf" "%%F\*.otf") do (
        .\slugfont.exe "%%i" -o "%%~dpi%%~ni.slug"
        if %errorlevel% neq 0 echo Error processing file: "%%i"
    )
)

echo Processing complete.
So what I did was make a slugs.bat in Addons, copied slugfont.exe to the Addons folder and then ran the batch file. It creates a .slug file within the Addon folder where it finds the font file with the same name.

Last edited by Sharlikran : 01/31/24 at 08:51 PM.
  Reply With Quote
01/30/24, 02:51 AM   #5
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
Info for Update 41- Fonts "Slug"

Addon creators can find a new tool, slugfont.exe, in the game directory that allows them to update their use of custom fonts to be compatible with the new system. Addons that make use of custom fonts will instead use default fonts until they receive an update, and fonts included with the game will continue to work without requiring an update. Instructions are provided in slugfont_readme.txt
  Reply With Quote
01/30/24, 03:02 AM   #6
Masteroshi430
 
Masteroshi430's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2020
Posts: 185
Here are the fonts I converted to slug for the minimap.
Attached Thumbnails
Click image for larger version

Name:	minimapff.png
Views:	129
Size:	4.9 KB
ID:	1658  
Attached Files
File Type: zip MinimapFonts.zip (2.57 MB, 125 views)

Last edited by Masteroshi430 : 01/30/24 at 03:04 AM.
  Reply With Quote
01/30/24, 02:20 PM   #7
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
I've put the bat file and the exe to live/AddOns/pChat and it somehow did not work

Originally Posted by Sharlikran View Post
Code:
@echo off
setlocal enabledelayedexpansion
set "LogFile=font_processing_log.txt"

echo Processing fonts...

for /d /r %%F in (*) do (
    set "parentFolder=%%F"
    set "parentFolder=!parentFolder:%CD%\=!"
    echo Searching in folder: "!parentFolder!"
    for %%i in ("%%F\*.ttf" "%%F\*.otf") do (
        if /I not "%%~xi" == ".dds" if /I not "%%~xi" == ".lua" if /I not "%%~xi" == ".xml" if /I not "%%~xi" == ".txt" (
            .\slugfont.exe "%%i" -o "%%~dpi%%~ni.slug"
            if %errorlevel% neq 0 echo Error processing file: "%%i"
        ) else (
            echo Skipping excluded file: "%%i"
        )
    )
)

echo Processing complete. Check %LogFile% for details.
So what I did was make a slugs.bat in Addons, copied slugfont.exe to the Addons folder and then ran the batch file. It creates a .slug file within the Addon folder where it finds the font file with the same name.


Thanks Sharlikran but it does not find the *.ttf and *.otf files in pChat/fonts/ e.g. /Arvo/Arvo-Regular.ttf?
The bat file runs, the command line opens, it writes Processing fonts... and then for each folder found 1 line with
Searching in folder: "!parentFolder!"

And then nothing, no return code/error code nor any error message nor skipped message.

At the end it writes the line Processing complete. Check %LogFile% for details. but there is no log file.
Maybe an Antivirus/Windows protection issue.

Edit:
Find attached the pChat slug files
Attached Files
File Type: zip 20240130_pChat-slug_fonts.zip (6.03 MB, 134 views)

Last edited by Baertram : 01/31/24 at 03:11 AM.
  Reply With Quote
01/31/24, 08:43 PM   #8
Sharlikran
 
Sharlikran's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 655
Process one single mod folder
Code:
@echo off
setlocal enabledelayedexpansion

rem Store the starting directory in a variable
set "StartingDirectory=%CD%"

echo Processing fonts...

rem Use the starting directory in the loop
for /d /r %%F in (*) do (
    set "parentFolder=%%F"
    set "parentFolder=!parentFolder:%StartingDirectory%\=!"
    echo Searching in folder: "!parentFolder!"
    for %%i in ("%%F\*.ttf" "%%F\*.otf") do (
        .\slugfont.exe "%%i" -o "%%~dpi%%~ni.slug"
        if %errorlevel% neq 0 echo Error processing file: "%%i"
    )
)

echo Processing complete.
This should work from the PChat folder. I dislike creating this file in the mods folder. However, to use this you create your batch file within the mods folder, and copy the slugfont.exe. Run the bat file and it will process the fonts.

Last edited by Sharlikran : 02/01/24 at 03:18 PM.
  Reply With Quote
02/01/24, 02:31 AM   #9
Masteroshi430
 
Masteroshi430's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2020
Posts: 185
I realised many addons use straight file path to use game fonts, to ensure compatibility with update 41 and future font updates, we must use ZOS' "$(MEDIUM_FONT)" type path.

Here is a little helper, if you used straight file path .ttf or .otf / change it to :
Code:
EsoUI/Common/Fonts/Univers57   
EsoUI/Common/Fonts/Univers57Cyrillic-Condensed
EsoUI/Common/Fonts/ESO_FWNTLGUDC70-DB
EsoUI/Common/Fonts/MYingHeiPRC-W5
                                                    /   "$(MEDIUM_FONT)"
EsoUI/Common/Fonts/Univers67 
EsoUI/Common/Fonts/MYingHeiPRC-W5
EsoUI/Common/Fonts/Univers67Cyrillic-CondensedBold
EsoUI/Common/Fonts/ESO_FWNTLGUDC70-DB
                                                   /   "$(BOLD_FONT)"
EsoUI/Common/Fonts/Univers57 
EsoUI/Common/Fonts/MYingHeiPRC-W5
EsoUI/Common/Fonts/Univers57Cyrillic-Condensed
EsoUI/Common/Fonts/ESO_FWUDC_70-M
                                                  /  "$(CHAT_FONT)"
EsoUI/Common/Fonts/FTN47
EsoUI/Common/Fonts/MYingHeiPRC-W5
EsoUI/Common/Fonts/ESO_FWNTLGUDC70-DB
                                                  /  "$(GAMEPAD_LIGHT_FONT)" 
EsoUI/Common/Fonts/FTN57
EsoUI/Common/Fonts/MYingHeiPRC-W5
EsoUI/Common/Fonts/ESO_FWNTLGUDC70-DB
                                                 /   "$(GAMEPAD_MEDIUM_FONT)" 
EsoUI/Common/Fonts/FTN87 
EsoUI/Common/Fonts/MYingHeiPRC-W5
EsoUI/Common/Fonts/ESO_FWNTLGUDC70-DB
                                                /  "$(GAMEPAD_BOLD_FONT)"
EsoUI/Common/Fonts/ProseAntiquePSMT
EsoUI/Common/Fonts/MYoyoPRC-Medium
EsoUI/Common/Fonts/ESO_KafuPenji-M
                                                /  "$(ANTIQUE_FONT)"
EsoUI/Common/Fonts/Handwritten_Bold
EsoUI/Common/Fonts/MYoyoPRC-Medium
EsoUI/Common/Fonts/ESO_KafuPenji-M
                                               /  "$(HANDWRITTEN_FONT)"  
EsoUI/Common/Fonts/TrajanPro-Regular 
EsoUI/Common/Fonts/ESO_KafuPenji-M
EsoUI/Common/Fonts/MYoyoPRC-Medium
                                               /  "$(STONE_TABLET_FONT)"

Last edited by Masteroshi430 : 02/01/24 at 02:35 AM.
  Reply With Quote
03/12/24, 08:41 AM   #10
shijina452
 
shijina452's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2022
Posts: 2
Chinese fonts

After converting Chinese fonts into slug format, the font file will become several times its original size. The size of the Chinese font library will become several hundred MB. Will this affect game performance?
  Reply With Quote
03/12/24, 08:51 AM   #11
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
I guess loading big files will always be a thing.
pChat font files size was doubled for each slug file.


About slugfont.exe params
Did you use -no-compress explicitly so compression of font files was off?
Else they should get compressed by default, but yeah the size is bigger than otf/ttf files before.

https://sluglibrary.com/SlugManual.pdf
Chapter 7 Font conversion
  Reply With Quote
03/12/24, 11:05 AM   #12
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,578
Not sure how much, but loading large files is bound to have some performance impact.

I also noticed the following comment in defaultfontstrings_simplifiedchinese.xml:
Code:
    <!-- Split out from GAMEPAD_MEDIUM_FONT so we don't have to generate outlines for large CJK fonts. 
    This currently saves about 100 MB of memory, but is only useful as long as we only use outlines with latin characters (usually numbers). -->
    <String name="GAMEPAD_MEDIUM_FONT_LATIN" value="EsoUI/Common/Fonts/FTN57.slug" />
So maybe disabling outlines could help reduce the size?
  Reply With Quote
03/13/24, 06:37 AM   #13
shijina452
 
shijina452's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2022
Posts: 2
Originally Posted by Baertram View Post
I guess loading big files will always be a thing.
pChat font files size was doubled for each slug file.


About slugfont.exe params
Did you use -no-compress explicitly so compression of font files was off?
Else they should get compressed by default, but yeah the size is bigger than otf/ttf files before.

https://sluglibrary.com/SlugManual.pdf
Chapter 7 Font conversion
Originally Posted by sirinsidiator View Post
Not sure how much, but loading large files is bound to have some performance impact.

I also noticed the following comment in defaultfontstrings_simplifiedchinese.xml:
Code:
    <!-- Split out from GAMEPAD_MEDIUM_FONT so we don't have to generate outlines for large CJK fonts. 
    This currently saves about 100 MB of memory, but is only useful as long as we only use outlines with latin characters (usually numbers). -->
    <String name="GAMEPAD_MEDIUM_FONT_LATIN" value="EsoUI/Common/Fonts/FTN57.slug" />
So maybe disabling outlines could help reduce the size?
Thanks for the reply. I have not changed the default parameters. The font is compressed. Since there are so many Chinese characters, the font is still very large after compression. I have given up on uploading a new version of the font plugin.
  Reply With Quote
04/16/24, 10:12 PM   #14
Verling
 
Verling's Avatar
AddOn Author - Click to view addons
Join Date: May 2021
Posts: 9
Angry

Originally Posted by Masteroshi430 View Post
I realised many addons use straight file path to use game fonts, to ensure compatibility with update 41 and future font updates, we must use ZOS' "$(MEDIUM_FONT)" type path.

Here is a little helper, if you used straight file path .ttf or .otf / change it to :
Code:
EsoUI/Common/Fonts/Univers57   
EsoUI/Common/Fonts/Univers57Cyrillic-Condensed
EsoUI/Common/Fonts/ESO_FWNTLGUDC70-DB
EsoUI/Common/Fonts/MYingHeiPRC-W5
                                                    /   "$(MEDIUM_FONT)"
EsoUI/Common/Fonts/Univers67 
EsoUI/Common/Fonts/MYingHeiPRC-W5
EsoUI/Common/Fonts/Univers67Cyrillic-CondensedBold
EsoUI/Common/Fonts/ESO_FWNTLGUDC70-DB
                                                   /   "$(BOLD_FONT)"
EsoUI/Common/Fonts/Univers57 
EsoUI/Common/Fonts/MYingHeiPRC-W5
EsoUI/Common/Fonts/Univers57Cyrillic-Condensed
EsoUI/Common/Fonts/ESO_FWUDC_70-M
                                                  /  "$(CHAT_FONT)"
EsoUI/Common/Fonts/FTN47
EsoUI/Common/Fonts/MYingHeiPRC-W5
EsoUI/Common/Fonts/ESO_FWNTLGUDC70-DB
                                                  /  "$(GAMEPAD_LIGHT_FONT)" 
EsoUI/Common/Fonts/FTN57
EsoUI/Common/Fonts/MYingHeiPRC-W5
EsoUI/Common/Fonts/ESO_FWNTLGUDC70-DB
                                                 /   "$(GAMEPAD_MEDIUM_FONT)" 
EsoUI/Common/Fonts/FTN87 
EsoUI/Common/Fonts/MYingHeiPRC-W5
EsoUI/Common/Fonts/ESO_FWNTLGUDC70-DB
                                                /  "$(GAMEPAD_BOLD_FONT)"
EsoUI/Common/Fonts/ProseAntiquePSMT
EsoUI/Common/Fonts/MYoyoPRC-Medium
EsoUI/Common/Fonts/ESO_KafuPenji-M
                                                /  "$(ANTIQUE_FONT)"
EsoUI/Common/Fonts/Handwritten_Bold
EsoUI/Common/Fonts/MYoyoPRC-Medium
EsoUI/Common/Fonts/ESO_KafuPenji-M
                                               /  "$(HANDWRITTEN_FONT)"  
EsoUI/Common/Fonts/TrajanPro-Regular 
EsoUI/Common/Fonts/ESO_KafuPenji-M
EsoUI/Common/Fonts/MYoyoPRC-Medium
                                               /  "$(STONE_TABLET_FONT)"
Thank you for making it easier. Only this is a closed list. Of the 9 variables, 6 do not work with national fonts. Only gamepad fonts are normally made. As a result, it is necessary to search and autocorrect the entire catalog of addons in the entire catalog code. But gamepad fonts are 4 sizes smaller than the rest.
  Reply With Quote
04/17/24, 10:25 AM   #15
Sharlikran
 
Sharlikran's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 655
@Verling

I looked at your Links to Ru Fonts mod and other mods to see which language you are using. Are you having issues with only Cyrillic Glyphs or fonts?

I noticed you had mentioned in the past that some mods don't seem to add support for what you refer to as national fonts. You noted that Master Merchant seemed to provide options to display national fonts as one example.

I don't think what I am about to describe applies to every mod but I also need to stress that ZOS already has fallback options for the internal slug files for the game.

Here is what ZOS uses for the definitions.

Xml Code:
  1. <String name="MEDIUM_FONT" value="EsoUI/Common/Fonts/Univers57.slug" />

That defines what an author would use when adding a new font.



Xml Code:
  1. <String name="MM_ESO_CARTOGRAPHER" value="MasterMerchant/Fonts/esocartographer-bold.slug" />

So that's how the font is added for Master Merchant. When a font does not have Cyrillic glyphs if you chose that then you would see boxes [] which is sometimes refereed to as Tofu where the Cyrillic glyph should be. Tofu is the name of the box [] symbol.

Xml Code:
  1. <BackupFont originalFont="$(MM_ESO_CARTOGRAPHER)" backupFont="EsoUI/Common/Fonts/ESO_FWNTLGUDC70-DB.slug"/>
  2. <BackupFont originalFont="$(MM_ESO_CARTOGRAPHER)" backupFont="EsoUI/Common/Fonts/ESO_KafuPenji-M.slug"/>
  3. <BackupFont originalFont="$(MM_ESO_CARTOGRAPHER)" backupFont="EsoUI/Common/Fonts/Univers67Cyrillic-CondensedBold.slug"/>

When you define the BackupFont then the game knows how to find the Glyphs that the font doesn't support. If nothing is specified then you will see Tofu [].

Master Merchant may seem like there is support for national fonts as you put it but there isn't anything that MM is doing that isn't already part of the ZOS code. The added fonts may not even have support for certain languages which is why ZOS added the BackupFont to begin with. You might select some of the fonts provided by MM and the font in the MM UI may look exactly the same. That is because the ZOS code uses the BackupFont because the Cyrillic Glyphs are missing. Which would default to something like Univers67Cyrillic-CondensedBold.slug for example.

Looking at the code for Links to Ru Fonts you are searching for all the instances of Zo in the name of the font and then if your conditions are met you set the font to univers57cyrillic-condensed.slug for example. I don't do that with Master Merchant. When you do that and when the fonts don't contain the Cyrillic Glyphs the BackupFont specified by ZOS is already being used.

What you are doing may help and you might be able to provide a few instances where fonts are not displayed properly unless you have your mod active but without any mods installed all fonts are displayed using the BackupFont specified by ZOS when the Glyph doesn't exist.

Another thing I'd like to mention:

Xml Code:
  1. <Label name="$(parent)Name" font="ZoFontGame" color="3689EF" modifyTextType="NONE" horizontalAlignment="LEFT" verticalAlignment="CENTER">
  2.   <Anchor point="TOPLEFT" relativeTo="$(parent)Buyer" relativePoint="TOPLEFT" offsetX="0" offsetY="0"/>
  3.   <Anchor point="BOTTOMRIGHT" relativeTo="$(parent)Buyer" relativePoint="BOTTOMRIGHT" offsetX="0" offsetY="0"/>
  4. </Label>
Even MM uses that in its Xml files, that isn't always going to be the font used because elsewhere in the Lua code the font is set to whatever MM specifies. So changing that manually in another authors mod may not do anything because Lua code could be using SetFont to change it later. That is more like saying use ZoFontGame by default for the Label until otherwise specified.

If you are really having that many issues that you feel like you need to "search and autocorrect the entire catalog of addons in the entire catalog code" then I would look at the mods you have installed. Maybe you simply need to uninstall some older mods that don't have recent updates to work correctly with the current code for the game. Doing that may make other mods that have recent updates function more to your expectations.
  Reply With Quote
04/18/24, 04:02 AM   #16
Verling
 
Verling's Avatar
AddOn Author - Click to view addons
Join Date: May 2021
Posts: 9
Originally Posted by Sharlikran View Post
I looked at your Links to Ru Fonts mod and other mods to see which language you are using. Are you having issues with only Cyrillic Glyphs or fonts?
...
Yes, there are problems with Russian blocks in fonts. I learned from friends that there are also problems in the Turkish interface.
I found out all these points in fonts in the first week after the release of 41 updates. Thank you for your detailed and complete description of them.
If only I had problems. I would make corrections to the directories on my computers. But many of my friends, guilds and all those who use the Russian interface have problems.
The problems are not only in the display of symbols in addons, but also in the non-functioning of game actions and part of the interface.

With addons disabled.
1 By holding Shift we send the name to the chat window. We get empty.
2 Letters from artisans and trade arrive without text.
3 The link to the guild and houses blocks the output of the entire block of text.

Links to Ru Fonts uses a hard reference to specific fonts in the client. I used DataExtractor to look at client resources and font lists.
And you’re right, it’s not possible to replace it everywhere. Are there addons which rigidly specify the design and the variables do not work.

For example, for Combat Metronome (AddOns\CombatMetronome\DariansUtilities\utility>Text.lua) it is not possible to specify a variable; it takes only direct
Code:
family = family or "esoui/common/fonts/univers57cyrillic-condensed.slug"
It is not possible to remove addons. Here is a short list of addons that are not fixed after installing Links to Ru Fonts.
CraftStoreFixedAndImproved - no list of ingredients in the supply.
CombatMetronome - skill [][][][][]
ArkadiusTradeTools - in the [] menu and empty product names.
CombatMetrics - no armor or weapon names
  Reply With Quote
04/18/24, 07:59 AM   #17
Sharlikran
 
Sharlikran's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 655
I work with balgamov and I did correct some of the issues but initially he changed Turkish letters like ğşı with gsi which I recommend he not do in the future because that's not how you resolve the situation.

Most likely Turkish players have similar issues where it is the Addon and not the main interface itself.

As for your issues where you have missing text without addons, please do the following.



Disable your addons that way so you don't need to remember which addons you had active. Then get screenshots of the issues you reported like holding shift and sending a name to chat with exact steps. As well as the mail with missing text from artisans and trade. Lastly how you reproduce guild and houses that blocks the text, with exact steps.

ZoSDanBatson is very collaborative and Russian is an official language so that can be addressed if it can be reproduced.

As far as all mods working correctly that's up to the authors to correct.

Last edited by Sharlikran : 04/18/24 at 09:57 AM.
  Reply With Quote
04/20/24, 02:05 PM   #18
Sharlikran
 
Sharlikran's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 655
@Verling

https://github.com/Rhyono/CraftStore/issues/47

I was going to update the fonts after you mentioned there was an issue with CraftStore. However, I have been able to look into it a bit and there is no font issue at all. It simply does not display the ingredients for Russian. I have been able to display the ingredients for several other languages including Korean.

Last edited by Sharlikran : 04/22/24 at 08:50 AM.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Upcoming changes to font rendering in Update 41


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off