You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Manuel Strehl <ma...@physik.uni-regensburg.de> on 2007/04/21 13:27:11 UTC

Force missing-glyph display

Hi.

I'm using Batik 1.6. With the rasterizer I want to convert SVGs with 
embedded fonts to PNGs. The SVGs are test cases for the fonts, so what 
is intended is, that the glyphs, that actually are in the font, are 
displayed, while all other letters are rendered using the 
<missing-glyph/> of the font.

Batik's behaviour so far is unfortunately to replace the font family 
instead of showing the missing-glyph.

Does anyone know, how to force Batik to use the <missing-glyph/>? Is 
this a SVG topic, that is, is there an SVG property for this?

By the way: I tried the
   -font-family ""
flag without success.

Best regards

Manuel


PS: Code snipped:

<svg>

   <font>
     <font-face font-family="test"/>
     <missing-glyph>
       <path d=""/>
     </missing-glyph>
     <glyph unicode="A" glyph-name="A">
       <path d=""/>
     </glyph>
   </font>

   <!-- should be rendered using glyph "A" -->
   <text> A </text>

   <!-- should be rendered using missing-glyph -->
   <text> B </text>

</svg>

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Force missing-glyph display

Posted by Manuel Strehl <ma...@physik.uni-regensburg.de>.
Thanks for the answer! I feared that it would be so...

Actually, I agree: in 99.9% of all cases you want to have shown 
something useful, even if the glyph's missing. It's just that my task 
hits the remaining case :-( So, if there's time left, I'll dive in the 
batik source.

Best regards
Manuel


thomas.deweese@kodak.com schrieb:
> Hi Manuel,
>
> Manuel Strehl <ma...@physik.uni-regensburg.de> wrote on 04/21/2007 
> 07:27:11 AM:
>
>   
>> I'm using Batik 1.6. With the rasterizer I want to convert SVGs with 
>> embedded fonts to PNGs. The SVGs are test cases for the fonts, so what 
>> is intended is, that the glyphs, that actually are in the font, are 
>> displayed, while all other letters are rendered using the 
>> <missing-glyph/> of the font.
>>
>> Batik's behaviour so far is unfortunately to replace the font family 
>> instead of showing the missing-glyph.
>>     
>
>    This is correct behavior for CSS.  The only way to avoid this
> would be to modify the code, I think the change is fairly minor
> in batik.gvt.renderer.StrokingTextPainter at approx line 541
> is where Batik implements the fallback behavior to search available
> fonts on the system to render chars.
>
>   
>> Does anyone know, how to force Batik to use the <missing-glyph/>? Is 
>> this a SVG topic, that is, is there an SVG property for this?
>>     
>
>    No there is no SVG property for this, and CSS assumes that you
> would prefer to see the text rather than missing glyphs (a fairly
> reasonable assumption given the problem set SVG/CSS is trying
> to address).
>
>   
>> By the way: I tried the
>>    -font-family ""
>> flag without success.
>>
>> Best regards
>>
>> Manuel
>>
>>
>> PS: Code snipped:
>>
>> <svg>
>>
>>    <font>
>>      <font-face font-family="test"/>
>>      <missing-glyph>
>>        <path d=""/>
>>      </missing-glyph>
>>      <glyph unicode="A" glyph-name="A">
>>        <path d=""/>
>>      </glyph>
>>    </font>
>>
>>    <!-- should be rendered using glyph "A" -->
>>    <text> A </text>
>>
>>    <!-- should be rendered using missing-glyph -->
>>    <text> B </text>
>>
>> </svg>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
>> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>>
>>     
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Force missing-glyph display

Posted by th...@kodak.com.
Hi Manuel,

Manuel Strehl <ma...@physik.uni-regensburg.de> wrote on 04/21/2007 
07:27:11 AM:

> I'm using Batik 1.6. With the rasterizer I want to convert SVGs with 
> embedded fonts to PNGs. The SVGs are test cases for the fonts, so what 
> is intended is, that the glyphs, that actually are in the font, are 
> displayed, while all other letters are rendered using the 
> <missing-glyph/> of the font.
> 
> Batik's behaviour so far is unfortunately to replace the font family 
> instead of showing the missing-glyph.

   This is correct behavior for CSS.  The only way to avoid this
would be to modify the code, I think the change is fairly minor
in batik.gvt.renderer.StrokingTextPainter at approx line 541
is where Batik implements the fallback behavior to search available
fonts on the system to render chars.

> Does anyone know, how to force Batik to use the <missing-glyph/>? Is 
> this a SVG topic, that is, is there an SVG property for this?

   No there is no SVG property for this, and CSS assumes that you
would prefer to see the text rather than missing glyphs (a fairly
reasonable assumption given the problem set SVG/CSS is trying
to address).

> By the way: I tried the
>    -font-family ""
> flag without success.
> 
> Best regards
> 
> Manuel
> 
> 
> PS: Code snipped:
> 
> <svg>
> 
>    <font>
>      <font-face font-family="test"/>
>      <missing-glyph>
>        <path d=""/>
>      </missing-glyph>
>      <glyph unicode="A" glyph-name="A">
>        <path d=""/>
>      </glyph>
>    </font>
> 
>    <!-- should be rendered using glyph "A" -->
>    <text> A </text>
> 
>    <!-- should be rendered using missing-glyph -->
>    <text> B </text>
> 
> </svg>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org