Thread Tools Display Modes
09-25-16, 06:26 PM   #1
Tonyleila
A Molten Giant
 
Tonyleila's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 758
Fonts not showing on Russian client (SharedMediaAdditionalFonts)

I have a very special problem with SharedMediaAdditionalFonts, it works fine on my German client but when I change the language to russian and create a char on a russian server the fonts are not loaded! Someone using my UI had this problem and I tested it out myself with the latest version to confirm.
As you can see in this screenshot AddOn loaded but you can't select other fonts: http://i.imgur.com/KZgViis.jpg
I also tested it with Cyrillic fonts.

Pb_ee1 the author of the AddOn stated that "all the fonts are actually registered to SharedMedia fully, however, I do have the same issue as you: they do not appear in the list of selectable fonts" and looks like he is out of ideas how to fix this.

So maybe someone else here has an idea!

To test yourself:
1. Change language in bnet client to russian then restart bnet
2. Open wow and change wow language to russian then close wow and restart bnet again
3. Open bnet and wow now you can create a char on russian server!
__________________
Author of: LeilaUI and Aurora: Missing Textures
__________________
  Reply With Quote
09-25-16, 07:58 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Is the Russian locale still called "ruRU"?
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
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))
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
09-28-16, 03:30 PM   #4
Tonyleila
A Molten Giant
 
Tonyleila's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 758
Thanks for clearing this up Phanx! So the current code I have is:


Code:
if not SharedMediaAdditionalFonts then return end
local revision = tonumber(string.sub("$Revision: 63551 $", 12, -3))
-- FONTS:
SharedMediaAdditionalFonts.revision = (revision > SharedMediaAdditionalFonts.revision) and revision or SharedMediaAdditionalFonts.revision
SharedMediaAdditionalFonts:Register("font", "Star Cine", [[Interface\Addons\SharedMediaAdditionalFonts\fonts\starcine.ttf]])

Coud I simply make it like this?
Code:
if not SharedMediaAdditionalFonts then return end
local revision = tonumber(string.sub("$Revision: 63551 $", 12, -3))
SharedMediaAdditionalFonts.revision = (revision > SharedMediaAdditionalFonts.revision) and revision or SharedMediaAdditionalFonts.revision
local LSM = LibStub("LibSharedMedia-3.0")
-- FONTS:
SharedMediaAdditionalFonts:Register("font", "Star Cine", "Interface\Addons\SharedMediaAdditionalFonts\fonts\starcine.ttf", bit.bor(LSM.LOCALE_BIT_western, LSM.LOCALE_BIT_ruRU))
Because it dosen't work :_(
__________________
Author of: LeilaUI and Aurora: Missing Textures
__________________

Last edited by Tonyleila : 09-28-16 at 03:43 PM.
  Reply With Quote
09-29-16, 09:23 PM   #5
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Your code isn't registering anything with LibSharedMedia itself. It's calling the "Register" method of "SharedMediaAdditionalFonts", and I don't have any idea what that method is doing. Most likely, it's failing to pass that third parameter on to LSM.

However, I don't really see the purpose in having that "SharedMediaAdditionalFonts" object as an intermediary anyway, regardless of whether this is your own code or the actual code in the SharedMediaAdditionalFonts addon. Just register the fonts directly with LSM -- change all instances of "SharedMediaAdditionalFonts:Register" to "LSM:Register" everything should work fine.

Edit:
Also, you should double-check that your font actually contains Cyrillic glyphs before flagging it as supporting the ruRU locale. Otherwise Russian users will be able to select it and get a nice UI full of ???? ??? ???? ??? ???? everywhere, which is exactly the situation LSM's locale filtering is intended to prevent.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
09-30-16, 07:52 PM   #6
Tonyleila
A Molten Giant
 
Tonyleila's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 758
Yep I double-checked I use this font: http://de.fonts2u.com/sony-sketch-ef.schriftart

I don't have any idea what that method is doing
I don't have any idea what anything here is doing something but I tryed to replace "SharedMediaAdditionalFonts:Register" with "LSM:Register" in the SharedMediaAdditionalFonts.lua however there still is a core.lua with a code that I don't know what its doing (I guess its to make it compatible with old SharedMedia versions) and whatever I do I can't get it to work it still displays nothing. Sooo I tryed to put it into my own AddOn and I noticed the square brackets are missing... hehe now it works (Also tested on RU)

Code:
LSM:Register("font", "Star Cine", [[Interface\Addons\LeilaMedia\Fonts\starcine.ttf]], bit.bor(LSM.LOCALE_BIT_western, LSM.LOCALE_BIT_ruRU))
__________________
Author of: LeilaUI and Aurora: Missing Textures
__________________

Last edited by Tonyleila : 09-30-16 at 08:37 PM.
  Reply With Quote
10-02-16, 10:35 AM   #7
burnrussia
A Kobold Labourer
Join Date: Oct 2016
Posts: 1
Can use flag "255" to support all locales
Lua Code:
  1. LSM:Register("font", "font name", "font path", 255)
  Reply With Quote
10-02-16, 09:53 PM   #8
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Yes, but you should not do that unless you are sure the font in question actually supports all locales -- if it doesn't include full coverage for Latin (including accented characters) and Cyrillic and Korean and Simplified Chinese and Traditional Chinese characters, you should absolutely not do that, or you will be serving up an ugly and unusable UI full of ???? ?? ??? ???? ?? to your users.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
10-26-16, 12:19 PM   #9
AllInOneMighty
A Defias Bandit
 
AllInOneMighty's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2006
Posts: 3
Originally Posted by Phanx View Post
Yes, but you should not do that unless you are sure the font in question actually supports all locales -- if it doesn't include full coverage for Latin (including accented characters) and Cyrillic and Korean and Simplified Chinese and Traditional Chinese characters, you should absolutely not do that, or you will be serving up an ugly and unusable UI full of ???? ?? ??? ???? ?? to your users.
Hello,

I'm the maintainer of the AddOn. ^-- is the reason why I do not want to add this font to the ruRU locale. If I do, most users will have an issue using it as it does not display all characters correctly, as shown on daFont.

You can still add it manually though!
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Fonts not showing on Russian client (SharedMediaAdditionalFonts)

Thread Tools
Display Modes

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