Jump to content


Photo

Text/font Question


  • Please log in to reply
3 replies to this topic

#1 49er

49er

    X-S Young Member

  • Members
  • Pip
  • 55 posts

Posted 25 November 2003 - 08:25 AM

I want to add some custom text - "TRACK" - using a custom font, so I put something like this in my skin:

<LayoutElement Type="Text" Font="Impact_18.xpr">
<Color>0x80FFFFFF</Color>
<Constant>TRACK</Constant>
<Pos x=200 y=200>
<Justify x=left y=center>
</LayoutElement>

When I load the skin, it shows the text in the default font.

(I can use the custom font for text that is sourced e.g. DateTime, but not with the <Constant> tag).

Any ideas?

#2 BenJeremy

BenJeremy

    X-S Elysian

  • Head Moderator
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 9,690 posts
  • Xbox Version:v1.1
  • 360 version:v1 (xenon)

Posted 25 November 2003 - 09:37 AM

QUOTE (49er @ Nov 25 2003, 04:25 AM)
I want to add some custom text - "TRACK" - using a custom font, so I put something like this in my skin:

<LayoutElement Type="Text" Font="Impact_18.xpr">
<Color>0x80FFFFFF</Color>
<Constant>TRACK</Constant>
<Pos x=200 y=200>
<Justify x=left y=center>
</LayoutElement>

When I load the skin, it shows the text in the default font.

(I can use the custom font for text that is sourced e.g. DateTime, but not with the <Constant> tag).

Any ideas?

Fonts have to be defined as a resource, then you use the resource name to identify the font.

#3 49er

49er

    X-S Young Member

  • Members
  • Pip
  • 55 posts

Posted 25 November 2003 - 11:23 AM

Hi - thanks for the reply.

Just to be absolutely clear:-

- I've named the font as a resource.

- It works with
<LayoutElement Type="Text" Source="DateTime" Font="Impact_18.xpr">
...
</LayoutElement>


- I can't get it to work with
]<LayoutElement Type="Text" Font="Impact_18.xpr">
<Constant>my custom text here</Constant>
...
</LayoutElement>


I must be missing something - I'll check again for typos when I get home.

(Great dash BTW)

#4 BenJeremy

BenJeremy

    X-S Elysian

  • Head Moderator
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 9,690 posts
  • Xbox Version:v1.1
  • 360 version:v1 (xenon)

Posted 25 November 2003 - 11:46 AM

QUOTE (49er @ Nov 25 2003, 07:23 AM)
Hi - thanks for the reply.

Just to be absolutely clear:-

- I've named the font as a resource.

- It works with
<LayoutElement Type="Text" Source="DateTime" Font="Impact_18.xpr">
...
</LayoutElement>


- I can't get it to work with
]<LayoutElement Type="Text" Font="Impact_18.xpr">
<Constant>my custom text here</Constant>
...
</LayoutElement>


I must be missing something - I'll check again for typos when I get home.

(Great dash BTW)

?? No, that shouldn't work, neither element.

CODE

 <Resource Type="Font" Name="Impact">
   <File>Impact_18.xpr</File>
 </Resource>


Then:

CODE

<LayoutElement Type="Text" Font="Impact">
<Color>0x80FFFFFF</Color>
<Constant>TRACK</Constant>
<Pos x=200 y=200>
<Justify x=left y=center>
</LayoutElement>


You must use the RESOURCE NAME for the element to be able to reference the font. This was done to conserve and consolidate resources. It also makes it a snap to make changes to the fonts, for example, without having to change a bunch of locations in the skin file.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users