[Xerte] Using stylesheet in Xerte3

Peter Huppertz peter.huppertz at baselgovernance.org
Tue Jun 29 12:53:04 BST 2010


OK never mind.

This is very cool:

Create a style.css with

@font-face {
  src: url("media/myfontfile.ttf");
  fontFamily: MyFont;
  embedAsCFF: false;
}
.header{
  color:#ff0000;
  fontFamily: "MyFont";
}

Compile the stylesheet, include it in Xerte and add the property "styleName: header" to a TextFieldIcon of your choice. You get a TextField using your special font, even if the user does not have the font on his/her computer. That is extremely useful for me cause I'm using a Handwriting font for some of my content. So COOL!
To reduce the filesize of you styles.swf you can even tell flash which characters to embed. E.g.:

@font-face {
  src: url("media/myfontfile.ttf");
  fontFamily: MyFont;
  embedAsCFF: false;    
  unicodeRange:
        U 0041-U 005A, /* Upper-Case [A..Z] */
        U 0061-U 007A, /* Lower-Case a-z */
        U 0030-U 0039, /* Numbers [0..9] */
        U 002E-U 002E; /* Period [.] */
}


On 29.06.2010, at 13:15, Julian Tenney wrote:

> I don’t know. Can you get it to work using Flex directly?
>  
> From: xerte-bounces at lists.nottingham.ac.uk [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Peter Huppertz
> Sent: 29 June 2010 12:10
> To: Xerte discussion list
> Subject: Re: [Xerte] Using stylesheet in Xerte3
>  
> OK, this works now - with one small question from my side:
>  
> I can apply styles I defined like .test { color: #ff0000; } now using the styleName property of a textfield. What does not work is using the <span class="test">My Text</span> syntax (which is more flexible, thus you can use multiple styles on a single textfield). I looked in the code and saw that you are using the StyleManager class, but I'm not totally sure if and how to use that for the class setting inside textfields. Perhaps I have to include something in the styleSheet property of the TextFieldIcon?! Do you have an idea.
>  
> Peter
>  
> On 29.06.2010, at 11:47, Julian Tenney wrote:
> 
> 
> That’s the problem – my older SDK swfs can’t load your newer SDK swfs.
>  
> From: xerte-bounces at lists.nottingham.ac.uk [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Peter Huppertz
> Sent: 29 June 2010 10:47
> To: Xerte discussion list
> Subject: Re: [Xerte] Using stylesheet in Xerte3
>  
> I used the one under "Stable Builds", but now downloaded the "Milestone Release". Will try it in a second.
>  
> On 29.06.2010, at 11:38, Julian Tenney wrote:
> 
> 
> 
> Use the Flex 4 release build 14159 – have Adobe made an updated SDK available as a release version yet?
>  
> From: xerte-bounces at lists.nottingham.ac.uk [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Peter Huppertz
> Sent: 29 June 2010 10:35
> To: Xerte discussion list
> Subject: Re: [Xerte] Using stylesheet in Xerte3
>  
> That's interesting. Your styles.swf works for me, too!
>  
> I use flex_sdk_4.1.0.16076 to compile it. Strange, as soon as I compile it, it does not work. I attached mine, but I guess it won't work on your computer, too.
>  
> _______________________________________________
> Xerte mailing list
> Xerte at lists.nottingham.ac.uk
> http://lists.nottingham.ac.uk/mailman/listinfo/xerte
>  
> ==================================
> Peter Huppertz
> E-learning and IT Specialist
> International Centre for Asset Recovery
> Basel Institute on Governance
> Phone: +41 61 205 55 18
> Fax: +41 61 267 55 19
>  
> _______________________________________________
> Xerte mailing list
> Xerte at lists.nottingham.ac.uk
> http://lists.nottingham.ac.uk/mailman/listinfo/xerte
>  
> ==================================
> Peter Huppertz
> E-learning and IT Specialist
> International Centre for Asset Recovery
> Basel Institute on Governance
> Phone: +41 61 205 55 18
> Fax: +41 61 267 55 19
>  
> _______________________________________________
> Xerte mailing list
> Xerte at lists.nottingham.ac.uk
> http://lists.nottingham.ac.uk/mailman/listinfo/xerte

==================================
Peter Huppertz
E-learning and IT Specialist
International Centre for Asset Recovery
Basel Institute on Governance
Phone: +41 61 205 55 18
Fax: +41 61 267 55 19

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20100629/02a1237c/attachment.html


More information about the Xerte mailing list