Thread Tools Display Modes
02-03-16, 09:39 AM   #1
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
MultiLang FontStrings

Is it possible to create a multi lang font like this in lua only?

XML Code:
  1. <FontFamily name="MyAddonFontNormalSmall" virtual="true">
  2.     <Member alphabet="roman">
  3.         <Font font="Fonts\FRIZQT__.TTF" height="9"/>
  4.     </Member>
  5.     <Member alphabet="korean">
  6.         <Font font="Fonts\2002.TTF" height="9"/>
  7.     </Member>
  8.     <Member alphabet="simplifiedchinese">
  9.         <Font font="Fonts\ARKai_C.ttf" height="11"/>
  10.     </Member>
  11.     <Member alphabet="traditionalchinese">
  12.         <Font font="Fonts\bHEI01B.TTF" height="11"/>
  13.     </Member>
  14.     <Member alphabet="russian">
  15.         <Font font="Fonts\FRIZQT___CYR.TTF" height="9"/>
  16.     </Member>
  17. </FontFamily>

I'm also unable to change the fontsize dinamically since GetFont() does not always return the proper fontPath, when called on UNIT_NAME_UPDATE:

Lua Code:
  1. local fontPath = frame.name.text:GetFont()
  2. frame.name.text:SetFont(fontPath, 9)

Any idea to create a workaround for this?

Last edited by Resike : 02-03-16 at 10:38 AM.
  Reply With Quote
02-07-16, 08:50 AM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
#1 - No.

#2 - Depending on your goal, you could try using SetTextHeight instead of SetFont. However, it may be better in the long run to simply remember what font you used when you created the font string or, if it's a Blizzard font string, just hardcode it, since SetTextHeight just rescales the rendered font string object and may not be very pretty.
__________________
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
02-08-16, 03:41 AM   #3
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Originally Posted by Phanx View Post
#1 - No.

#2 - Depending on your goal, you could try using SetTextHeight instead of SetFont. However, it may be better in the long run to simply remember what font you used when you created the font string or, if it's a Blizzard font string, just hardcode it, since SetTextHeight just rescales the rendered font string object and may not be very pretty.
Thats not really an option, since i would use the font for unitframes and you will never know where and when the unit is gonna get replaced with a russian. However it would be real nice to properly show ciril characters instead of the "?????????????????".

But i find that dumb that i need to create a bunch of font with different size, if i want to allow the user to increase or decrease the font size.

Somebody could poke blizzard to add this funciton into lua possible with proper dinamic size and font changes, i'm from EU they don't take me seriously. :P

Last edited by Resike : 02-08-16 at 03:51 AM.
  Reply With Quote
02-08-16, 06:13 AM   #4
Voyager
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 22
Originally Posted by Resike View Post
Thats not really an option, since i would use the font for unitframes and you will never know where and when the unit is gonna get replaced with a russian. However it would be real nice to properly show ciril characters instead of the "?????????????????".
Didn't they fix the font to show european and russian letters correctly? You could also use a font that can show both.
  Reply With Quote
02-08-16, 08:17 AM   #5
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Originally Posted by Voyager View Post
Didn't they fix the font to show european and russian letters correctly? You could also use a font that can show both.
Read my original post.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » MultiLang FontStrings


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