Getting fonts to work

40 views
Skip to first unread message

Arne Brutschy

unread,
Apr 11, 2013, 4:13:13 PM4/11/13
to caa...@googlegroups.com
Hey,

I am trying to get fonts to work. Unfortunately, it seems a bit
"unreliable". I use in my css:

@font-face {
font-family: abcd;
src: local("fonts/abcd.ttf");
font-weight: normal;
font-style: normal;
}

In my html:

<div style="font-family: 'abcd'; float:left;">&nbsp;</div>

In my javascript:

var oFontABCD = (new CAAT.Module.Font.Font()).
setFont('"abcd"').
setFontSize(100,"px").
setFillStyle('#000').
setStrokeStyle('#000').
setStrokeSize(0.5).
createDefault(10);

this.oTextActor = (new CAAT.Foundation.UI.TextActor()).
setFont(oFontABCD).
...

So basically I follow the fonts demo that can be found on the CAAT
site. Unfortunately, this does not produce any output. It does work on
one system with Chromium. Other browsers (or even Chromium on another
system) do not work. Am I missing something obvious here, or is this a
bug?

Cheers,
Arne

Arne Brutschy

unread,
May 3, 2013, 6:19:48 AM5/3/13
to caa...@googlegroups.com
Hey,

I tested demo27 (using Google fonts in CAAT) and it does not work at
all. Tested on Firefox 20.0 and Chrome 25.0.1364.172 (both on Ubuntu 12.04).

Could someone else verify this please?

Arne

hyperandroid

unread,
May 4, 2013, 1:59:05 PM5/4/13
to caa...@googlegroups.com

you are right.
will fix asap.
thanks.

- i

--
You received this message because you are subscribed to the Google Groups "CAAT javascript framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to caatjs+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Karottes Lucifer

unread,
Dec 28, 2013, 6:21:21 AM12/28/13
to caa...@googlegroups.com, abru...@xylon.de
Can us use external fonts now ?...

This demo works, why my script doesn't ? O.o Maybe not the same version, obviously, but why a recent version of CAAT can't do what an old doing ?...

Karottes Lucifer

unread,
Dec 28, 2013, 6:41:26 AM12/28/13
to caa...@googlegroups.com, abru...@xylon.de
Okay, I have a solution.
Use a Module.Font.Font() don't works ... so we'll use directly the TextActor with the name of your wanted font (Google font if you want) :
var title = new CAAT.Foundation.UI.TextActor().
      setFont("80px Google Font").
      setLocation(this.director.width, 10).
      setText("My font is applied !").
      setAlign("center");

Goodbye : )
Reply all
Reply to author
Forward
0 new messages