Getting fonts to work

Visto 41 veces
Saltar al primer mensaje no leído

Arne Brutschy

no leída,
11 abr 2013, 16:13:1311/4/13
a 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

no leída,
3 may 2013, 6:19:483/5/13
a 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

no leída,
4 may 2013, 13:59:054/5/13
a 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

no leída,
28 dic 2013, 6:21:2128/12/13
a 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

no leída,
28 dic 2013, 6:41:2628/12/13
a 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 : )
Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos