EQ2Interface

EQ2Interface (https://www.eq2interface.com/forums/index.php)
-   UI Developer Discussion (https://www.eq2interface.com/forums/forumdisplay.php?f=3)
-   -   Why will my font not load? (https://www.eq2interface.com/forums/showthread.php?t=15250)

DaemonSambe 01-01-2011 08:04 PM

Why will my font not load?
 
3 Attachment(s)
I'm working on a ui replacement for mainhud_player, inlcuded below. It uses a custom textstyle, included below. The textstyle uses a custom font, included below.

The problem is, i cannot get the custom font type to load into the ui. It patently refuses to obey the textsyle and it's pissing me off. Does anyone have an idea why it will not work, based on the code? If you look at the code, the Emblem font should be used to display the HP%, but it loads the default font type instead, but adjusts to my specified font size.

However, in UIBuilder, it loads fine. I've also tried using one of the default styles, CombatBubbleCrit, but again it loads the default font type.

Please please help. I want this to work.

Regads.

TW Shrub 01-02-2011 01:39 PM

One thing I see in the eq2ui_textstyles.xml file is that in the TextStyle definition for "56" (about line 110); the FontName is set to Arial rather than Emblem.

It has been my experience that while in-game it will use the FontName property to determine which font to use regardless of what the PrivateFontPath property actually points to. In contrast, the UIBuilder will (seemingly) always use the PrivateFontPath regardless of what the FontName says (just the oppposite of the in-game behavior).

It worked fine for me when I just changed the FontName property to "Emblem":

<TextStyle Algorithm="Simple" FontName="Emblem" Language="english" Leading="-2" Name="56" PointSize="56" PrivateFontPath="UI/Fonts/Emblem.ttf" UseCachedFont="true"/>

rather than:
<TextStyle Algorithm="Simple" FontName="Arial" Language="english" Leading="-2" Name="56" PointSize="56" PrivateFontPath="UI/Fonts/Emblem.ttf" UseCachedFont="true"/>

This may only be true when UseCachedFont is set to true but that is how I have always done fonts so this behavior may not hold true when not using cached fonts.

DaemonSambe 01-02-2011 04:32 PM

Oh man. I was certain i had made that change without any effect, but i realize now, that it might have been another thing interferring. It seems that selecting Small Sans Serif Font, in the UI Options panel, overwrites just about every font change i specified. And removing it, changed all of the fonts, that i didn't specify, to that old ugly one. Have to go back and manually set font styles i throughout. But thanks man, that did load the Emblem properly.

.Regards

DaemonSambe 01-02-2011 05:42 PM

Font spacing
 
3 Attachment(s)
I redid the window, using specific fonts. I decided to use a font i used in WoW, Roth, which is nice clean and legible.
For some reason, however, EQ does something horrid with the spacing. For instance, 11, sits on top of each other. Which is something that i know didn't occur in WoW. I even have screenshots of my ui using Roth, to compare.

So i'm wondering if there are any settings i can adjust in the textstyles sheet that will makeup for this behaviour.

Here's the font, and screenies.

.Regards

DaemonSambe 01-03-2011 10:10 AM

Colors
 
So i'm almost done with my Player/Target mod. The last problem had to do with the HP%, and the fact that i hate having that % sign there for no particular reason. I got around it, by using an invisible text box for the dynamic data, and truncating the HP%. Then i tried grabbing the color from the dynamicdata to adjust the output data to match. It works fairly well, but there's a delay in the color change. The output box, is one cycle behind the dynamicdata, meaning it will not change colors for a full tick.

Here's the code snippet:
Code:

        <Page OnPress="target_self target_self" Location="150,0" Name="HPPrcnt" Size="101,65" >
                <Text AbsorbsInput="false" DynamicData="/GameData.Self.Health" DynamicDataFilter="FFFB" Font="/_Styles.Fonts.Large" LocalText="85%" Location="2,0" MaxLines="1" Name="Axp" ScrollExtent="130,80" ShadowStyle="/ShadowStyles.BlackOutlineNoShadow.Outline1" Size="150,80" Color="#00FF40" TooltipStyle="/TooltipStyles.tooltip_default" TextAlignment="left" TruncateElipsis="false" ontextchanged="
                parent.HPp.text = int(localtext)
                "/>
                <Text AbsorbsInput="false" Font="/_Styles.Fonts.EpicLarge" LocalText="85%" Location="2,0" MaxLines="1" Name="HPp" ScrollExtent="130,80" ShadowStyle="/ShadowStyles.BlackOutlineNoShadow.Outline1" Size="150,80" Color="#00FF40" TooltipStyle="/TooltipStyles.tooltip_default" TextAlignment="left" TruncateElipsis="false" ontextchanged="
                color = parent.Axp.color
                "/>
        </Page>

Anyone have an idea of how to make the color match the dynamicdata, cycle for cycle?

.Regards

TW Shrub 01-03-2011 08:11 PM

What I would do is add the DynamicData (/GameData.Self.Health) to the "HPp" text object itself and then add a DynamicDataFilter to filter out everything except the color data.
If I remember correctly, the DynamicDataFilter for the color is "0400" but I don't have the documentation in front of me so that may be incorrect.

That way the text should change color as soon as the DynamicData changes and you can eliminate one UI object query (which may be the cause of the delay you're seeing).

DaemonSambe 01-03-2011 08:41 PM

Wooo. Thanks a ton. With that it worked perfectly, and i now understand DynamicDataFilters. Beautiful.

.Regards


All times are GMT -5. The time now is 05:48 AM.

vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI