Quantcast WoWInterface - View Single Post - Fonts not showing on Russian client (SharedMediaAdditionalFonts)
View Single Post
09-25-16, 08:59 PM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
This isn't a bug. LibSharedMedia assumes by default that fonts registered to it only support the Latin alphabet, and ignores them in Russian, Korean, or Chinese clients. If a font does include Cyrillic (Russian), Chinese, and/or Korean glyphs, the addon registering it needs to tell LSM that by passing the optional third argument to :Register.

See the API documentation here:

https://www.wowace.com/addons/libsha...-data-langmask

https://www.wowace.com/addons/libsha...mask-constants

Example of registering a font that includes Latin and Cyrillic glyphs:

Code:
local LSM = LibStub("LibSharedMedia-3.0")
LSM:Register("font", "PT Sans",
    "Interface\\AddOns\\PhanxMedia\\font\\PTSans.ttf",
    bit.bor(LSM.LOCALE_BIT_western, LSM.LOCALE_BIT_ruRU))
Example of registering a font with Latin and Chinese glyphs:

Code:
local LSM = LibStub("LibSharedMedia-3.0")
LSM:Register("font", "XYZ",
    "Interface\\AddOns\\PhanxMedia\\font\\XYZ.ttf",
    bit.bor(LSM.LOCALE_BIT_western, LSM.LOCALE_BIT_zhCN, LSM.LOCALE_BIT_zhTW))
Example of registering a font with Chinese and Korean glyphs (no Latin):

Code:
local LSM = LibStub("LibSharedMedia-3.0")
LSM:Register("font", "ABC",
    "Interface\\AddOns\\PhanxMedia\\font\\ABC.ttf",
    bit.bor(LSM.LOCALE_BIT_koKR, LSM.LOCALE_BIT_zhCN, LSM.LOCALE_BIT_zhTW))
__________________
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
  Reply With Quote