Font selection

classic Classic list List threaded Threaded
3 messages Options
Dave Thorn Dave Thorn
Reply | Threaded
Open this post in threaded view
|

Font selection

Hi,

I'm using jlatexmath[1] to generate PNGs of formulae.  Is there some
way to change the font?  It's been requested that we display them in
Arial - whether that exists, or "something similar".

I looked for 'font' inside the jar file and there're a lot of things
there, but I'm not sure how to specify them.

Thanks,


[1] ISTR I manually added it to my local repository
   <dependency>
      <groupId>org.scilab.forge.jlatexmath</groupId>
      <artifactId>jlatexmath</artifactId>
      <version>0.9.6</version>
    </dependency>

calixte calixte
Reply | Threaded
Open this post in threaded view
|

Re: Font selection

Hi Dave,

The default fonts are the cm fonts (ttf files) and the metric files (tfm
files) have been converted in xml format. It is a good way to have the
same rendering as in TeX. A character bounding box is not always the
same as one given by java (which returns the true bounding box). You can
have a look on the bounding boxes in using:

TeXFormula f = new TeXFormula("\\text{Hello World !}");
f.setDEBUG(true);

You will see the bounding boxes in your picture.

It is possible to change the default font for text and numbers in using:
TeXFormula.registerExternalFont(Character.UnicodeBlock.BASIC_LATIN,
"arial");

You can use different fonts with different UnicodeBlocks.

An other way: you can use "\\jlmExternalFont{arial}... \
\jlmText{Hello}...", Hello will be rendered in using arial.

For now it is not possible to change the fonts to render maths (i.e.
symbols (sum, integral, ...), greek vars, operators (+,-,...), ...)

Regards,

Calixte

Le vendredi 12 août 2011 à 12:22 +0100, Dave Thorn a écrit :

> Hi,
>
> I'm using jlatexmath[1] to generate PNGs of formulae.  Is there some
> way to change the font?  It's been requested that we display them in
> Arial - whether that exists, or "something similar".
>
> I looked for 'font' inside the jar file and there're a lot of things
> there, but I'm not sure how to specify them.
>
> Thanks,
>
>
> [1] ISTR I manually added it to my local repository
>    <dependency>
>       <groupId>org.scilab.forge.jlatexmath</groupId>
>       <artifactId>jlatexmath</artifactId>
>       <version>0.9.6</version>
>     </dependency>



Dave Thorn Dave Thorn
Reply | Threaded
Open this post in threaded view
|

Re: Font selection

Hi,

Thanks for the prompt rely and excellent information.  I wasn't sure
how alive the list was.

That seems to have solved my problem (until the boss decides it hasn't, ofc).

I'll hang around on the off-chance I can be useful to anyone else.

Cheers,

On 12 August 2011 13:01, calixte <[hidden email]> wrote:

> Hi Dave,
>
> The default fonts are the cm fonts (ttf files) and the metric files (tfm
> files) have been converted in xml format. It is a good way to have the
> same rendering as in TeX. A character bounding box is not always the
> same as one given by java (which returns the true bounding box). You can
> have a look on the bounding boxes in using:
>
> TeXFormula f = new TeXFormula("\\text{Hello World !}");
> f.setDEBUG(true);
>
> You will see the bounding boxes in your picture.
>
> It is possible to change the default font for text and numbers in using:
> TeXFormula.registerExternalFont(Character.UnicodeBlock.BASIC_LATIN,
> "arial");
>
> You can use different fonts with different UnicodeBlocks.
>
> An other way: you can use "\\jlmExternalFont{arial}... \
> \jlmText{Hello}...", Hello will be rendered in using arial.
>
> For now it is not possible to change the fonts to render maths (i.e.
> symbols (sum, integral, ...), greek vars, operators (+,-,...), ...)
>
> Regards,
>
> Calixte
>
> Le vendredi 12 août 2011 à 12:22 +0100, Dave Thorn a écrit :
>> Hi,
>>
>> I'm using jlatexmath[1] to generate PNGs of formulae.  Is there some
>> way to change the font?  It's been requested that we display them in
>> Arial - whether that exists, or "something similar".
>>
>> I looked for 'font' inside the jar file and there're a lot of things
>> there, but I'm not sure how to specify them.
>>
>> Thanks,
>>
>>
>> [1] ISTR I manually added it to my local repository
>>    <dependency>
>>       <groupId>org.scilab.forge.jlatexmath</groupId>
>>       <artifactId>jlatexmath</artifactId>
>>       <version>0.9.6</version>
>>     </dependency>
>
>
>