Maintenance for the week of December 23:
• NA megaservers for maintenance – December 23, 4:00AM EST (9:00 UTC) - 9:00AM EST (14:00 UTC)
• EU megaservers for maintenance – December 23, 9:00 UTC (4:00AM EST) - 14:00 UTC (9:00AM EST)

[Request] Simple Font Replacement

Aortick
Aortick
✭✭✭
Could one of you Add-on Creators create a Simple Font Replacement Add-on with the "Trajan Pro" font? I am currenty using Pawksickles but, 1- It's Out of Date (no big deal suppose) and 2- There are just way too many Options (again, no big deal). However I would just like to use "Trajan Pro" as the default font.

So is there a simple way of doing this? Or is "Pawksickles" as simple as it gets? I would try this myself, but my coding skills are that of a Wolf trying to build a Space Station.
Edited by Aortick on July 18, 2014 8:04PM
  • Garkin
    Garkin
    ✭✭✭
    It is possible to write simple function which will replace all fonts with Trajan Pro, but it will probably make your UI unreadable. I recommend to stick with Pawksickles, because you can define which fonts should be replaced.

    If you want to try it:
    for key,value  in zo_insecurePairs(_G) do
       if (key):find("^Zo") and type(value) == "userdata" and value.SetFont then
          local font = {value:GetFontInfo()}
          font[1] = "EsoUI/Common/Fonts/TrajanPro-Regular.otf"
          value:SetFont(table.concat(font, "|"))
       end
    end
    

    Screenshots:
    http://imgur.com/a/bZLPq
    Edited by Garkin on July 19, 2014 5:05PM
    Garkin / EU / CSF guild
    My addons: SkyShards, LoreBooks, Dustman, Map Coordinates, No, thank you, ... (full list)
    I'm taking care of: Azurah - Interface Enhanced, Srendarr - Aura, Buff & Debuff Tracker and more
    My folder with updated/modified addons: DROPBOX
  • Aortick
    Aortick
    ✭✭✭
    Thanks for the Reply. However I'm not sure what to do with that code. Do I copy&paste it somewhere? I did try to make a .lua out of it lol, but an error keep popping up about Line 6 "end" (I believe).

    Btw thanks for the help and also for sharing your Add-ons. They are most Useful.
    Edited by Aortick on July 19, 2014 6:35AM
  • zgrssd
    zgrssd
    ✭✭✭✭
    Garkin wrote: »
    It is possible to write simple function which will replace all fonts with Trajan Pro, but it will probably make your UI unreadable. I recommend to stick with Pawksickles, because you can define which fonts should be replaced.

    If you want to try it:
    for key,value  in zo_insecurePairs(_G) do
       if (key):find("^Zo") and type(value) == "userdata" and value.SetFont then
          local font = {value:GetFontInfo()}
          font[1] = "EsoUI/Common/Fonts/TrajanPro-Regular.otf"
          value:SetFont(table.concat(font, "|")
       end
    end
    

    Screenshots:
    http://imgur.com/a/bZLPq
    It goes over the global table.
    It finds all entries that start with "Zo", are of type "userdata" and contain a SetFont function (index is not nil).
    For each of those it does:
    Extract the current FontInfo (propably includes stuff like Size, Boldness and other formatting too; common pattern for UI Font settings).
    Replaces only the font to use.
    Applies the modified value.

    So it just bulk overwrites the font to use, without preserving the original setting in any way.
    Elana Peterson (EU), Dominion, Imperial Sorc, Rune & Alchemy Crafting Char
    Leonida Peterson (EU), Daggerfall, Kajiit Nightblade, Tank & main Crafter
    Kurga Peterson (EU), Ebonhart, Ork Dragonknight, Provision Mule
    Coldblood Peterson (EU) Argonian Templer, Daggerfall, Healer
    Incendia Peterson (EU), Dominion, Dunmer Dragonknight, fire DPS & healer
    Haldor Belendor (EU), Ebonhart, Breton Sorcerer, Tank
    Fuliminictus Peterson (EU), Ebonhart, Altmer Sorcerer, Electric DPS

    Me babbling about PvE roles and Armor, Short Guide to Addon Programming (for Programmers)

    If you think anything I or somebody else said violates the Rules of this Forum, you are free to flag my posts. Till I get any notifcaion from this, I just asume you know you have no case against me or Zenimax disagrees with you.
  • zgrssd
    zgrssd
    ✭✭✭✭
    Finding some values in the Global table named after a pattern (Basically this is a Font type enumeration) is exactly why I created LibConstantMapper in the first place.
    I already made some tests. A total of 65 "Zo..." Variables are in the global table.
    63 of those are ZoFont..., the other two are "ZoInteractionPromt" and "ZoLargeFontEdit", of wich I am not certain if they are related to this case. But garkins check for the existing function should take care of that.

    I have to push the 0.6 version live before you can use it for this, but the tests look good so far.
    Edited by zgrssd on July 19, 2014 7:56AM
    Elana Peterson (EU), Dominion, Imperial Sorc, Rune & Alchemy Crafting Char
    Leonida Peterson (EU), Daggerfall, Kajiit Nightblade, Tank & main Crafter
    Kurga Peterson (EU), Ebonhart, Ork Dragonknight, Provision Mule
    Coldblood Peterson (EU) Argonian Templer, Daggerfall, Healer
    Incendia Peterson (EU), Dominion, Dunmer Dragonknight, fire DPS & healer
    Haldor Belendor (EU), Ebonhart, Breton Sorcerer, Tank
    Fuliminictus Peterson (EU), Ebonhart, Altmer Sorcerer, Electric DPS

    Me babbling about PvE roles and Armor, Short Guide to Addon Programming (for Programmers)

    If you think anything I or somebody else said violates the Rules of this Forum, you are free to flag my posts. Till I get any notifcaion from this, I just asume you know you have no case against me or Zenimax disagrees with you.
  • Aortick
    Aortick
    ✭✭✭
    zgrssd wrote: »
    Finding some values in the Global table named after a pattern (Basically this is a Font type enumeration) is exactly why I created LibConstantMapper in the first place.
    I already made some tests. A total of 65 "Zo..." Variables are in the global table.
    63 of those are ZoFont..., the other two are "ZoInteractionPromt" and "ZoLargeFontEdit", of wich I am not certain if they are related to this case. But garkins check for the existing function should take care of that.

    I have to push the 0.6 version live before you can use it for this, but the tests look good so far.
    All over my head my friend, I'm not even sure what do with the Code Garkin gave :(
    Edited by Aortick on July 19, 2014 8:08AM
  • Garkin
    Garkin
    ✭✭✭
    Aortick wrote: »
    Thanks for the Reply. However I'm not sure what to do with that code. Do I copy&paste it somewhere? I did try to make a .lua out of it lol, but an error keep popping up about Line 6 "end" (I believe).

    Btw thanks for the help and also for sharing your Add-ons. They are most Useful.
    If you want to try what code does you can either copy&paste it to the end of any .lua file in your addons folder or use @Seerah's addon ZAM Notebook which can run code snippets.
    Garkin / EU / CSF guild
    My addons: SkyShards, LoreBooks, Dustman, Map Coordinates, No, thank you, ... (full list)
    I'm taking care of: Azurah - Interface Enhanced, Srendarr - Aura, Buff & Debuff Tracker and more
    My folder with updated/modified addons: DROPBOX
  • Aortick
    Aortick
    ✭✭✭
    I have tried that with every .lua file I have, this is what happens. http://i.imgur.com/Yz8MuUu.jpg
  • Garkin
    Garkin
    ✭✭✭
    Aortick wrote: »
    I have tried that with every .lua file I have, this is what happens. http://i.imgur.com/Yz8MuUu.jpg

    Missing bracket on this line: :blush:
    value:SetFont(table.concat(font, "|"))
    
    I have updated original post to fix the issue.
    Edited by Garkin on July 19, 2014 5:08PM
    Garkin / EU / CSF guild
    My addons: SkyShards, LoreBooks, Dustman, Map Coordinates, No, thank you, ... (full list)
    I'm taking care of: Azurah - Interface Enhanced, Srendarr - Aura, Buff & Debuff Tracker and more
    My folder with updated/modified addons: DROPBOX
  • Aortick
    Aortick
    ✭✭✭
    Dude you are Awesome!! This is exactly what I was wanting. So I made into its own Add-On, changed the font, and had to lower the UI Scale (well, I had already done that). This is the result, much better than the original font imo.
    http://imgur.com/a/ft772#0
    Edited by Aortick on July 19, 2014 6:43PM
  • Garkin
    Garkin
    ✭✭✭
    Just for people who wants to replace ingame fonts - I have uploaded updated version of @Pawkette's Pawksickles to ESOUI:
    http://www.esoui.com/downloads/info723-PawksicklesUpdated.html
    Garkin / EU / CSF guild
    My addons: SkyShards, LoreBooks, Dustman, Map Coordinates, No, thank you, ... (full list)
    I'm taking care of: Azurah - Interface Enhanced, Srendarr - Aura, Buff & Debuff Tracker and more
    My folder with updated/modified addons: DROPBOX
Sign In or Register to comment.