WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Fonts not showing on Russian client (SharedMediaAdditionalFonts) (https://www.wowinterface.com/forums/showthread.php?t=54538)

Tonyleila 09-25-16 06:26 PM

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!

Seerah 09-25-16 07:58 PM

Is the Russian locale still called "ruRU"?

Phanx 09-25-16 08:59 PM

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))


Tonyleila 09-28-16 03:30 PM

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 :_(

Phanx 09-29-16 09:23 PM

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. :p

Tonyleila 09-30-16 07:52 PM

Yep I double-checked I use this font: http://de.fonts2u.com/sony-sketch-ef.schriftart

Quote:

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))

burnrussia 10-02-16 10:35 AM

Can use flag "255" to support all locales
Lua Code:
  1. LSM:Register("font", "font name", "font path", 255)

Phanx 10-02-16 09:53 PM

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.

AllInOneMighty 10-26-16 12:19 PM

Quote:

Originally Posted by Phanx (Post 319619)
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!


All times are GMT -6. The time now is 10:04 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI