1.5.1 -> 1.6 change

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

1.5.1 -> 1.6 change

Archie Cobbs
It appears that whereas in Batik 1.5.1, a <text> tag with a missing
"font-family" would still appear, but in Batik 1.6 the text does not
appear without a "font-family" attribute. Adding font-family="Arial"
(for example) makes it appear again.

For example, view this in squiggle 1.5.1 and squiggle 1.6:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
     "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" >

<svg height="100" overflow="visible" viewBox="0 0 100 100" width="100"
      xml:space="preserve" xmlns="http://www.w3.org/2000/svg"
      xmlns:xlink="http://www.w3.org/1999/xlink">
     <text font-size="10" text-anchor="middle"
           x="50" y="50">Hello World</text></svg>

Just curious.. is this a regression or a bug fix?

Thanks,
-Archie

__________________________________________________________________________
Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: 1.5.1 -> 1.6 change

thomas.deweese
Hi Archie,

Archie Cobbs wrote:
> It appears that whereas in Batik 1.5.1, a <text> tag with a missing
> "font-family" would still appear, but in Batik 1.6 the text does not
> appear without a "font-family" attribute. Adding font-family="Arial"
> (for example) makes it appear again.

    I seem to be a broken record today, but it works fine for me in 1.6.
Does it really not show for you with a fresh copy of the 1.6 squiggle?

> For example, view this in squiggle 1.5.1 and squiggle 1.6:
>
> <?xml version="1.0" encoding="utf-8"?>
> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
>     "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" >
>
> <svg height="100" overflow="visible" viewBox="0 0 100 100" width="100"
>      xml:space="preserve" xmlns="http://www.w3.org/2000/svg"
>      xmlns:xlink="http://www.w3.org/1999/xlink">
>     <text font-size="10" text-anchor="middle"
>           x="50" y="50">Hello World</text></svg>
>
> Just curious.. is this a regression or a bug fix?
>
> Thanks,
> -Archie
>
> __________________________________________________________________________
> Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: 1.5.1 -> 1.6 change

Archie Cobbs
Thomas DeWeese wrote:
>> It appears that whereas in Batik 1.5.1, a <text> tag with a missing
>> "font-family" would still appear, but in Batik 1.6 the text does not
>> appear without a "font-family" attribute. Adding font-family="Arial"
>> (for example) makes it appear again.
>
>    I seem to be a broken record today, but it works fine for me in 1.6.
> Does it really not show for you with a fresh copy of the 1.6 squiggle?

No.. but I'm not surprised. This is probably another JVM font issue
(I've had some in the past).

Is that possibility consistent with what you know about how Batik handles
text with no explicit "font-family" ? What is the "default" font family?

Thanks,
-Archie

__________________________________________________________________________
Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: 1.5.1 -> 1.6 change

thomas.deweese
Archie Cobbs wrote:

>>    I seem to be a broken record today, but it works fine for me in 1.6.
>> Does it really not show for you with a fresh copy of the 1.6 squiggle?
>
> No.. but I'm not surprised. This is probably another JVM font issue
> (I've had some in the past).
>
> Is that possibility consistent with what you know about how Batik handles
> text with no explicit "font-family" ? What is the "default" font family?

    The CSS engine will always provide a font-family.  The default font
family comes from the 'CSSContext' which is implemented by the
BridgeUserAgent in the JSVGComponent to return:
         "Arial, Helvetica, sans-serif"

    If however you have provided a custom SVGUserAgent instance it
will be deferred to that.  I would think that the problem would have
to be pretty nasty for no text to be displayed, as it will try all
of the above in order, and Java pretty much always provides a
'sans-serif' pseudo font.

    But I suppose if your Arial was corrupt they might all map to that.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: 1.5.1 -> 1.6 change

Archie Cobbs
Thomas DeWeese wrote:

>>>    I seem to be a broken record today, but it works fine for me in 1.6.
>>> Does it really not show for you with a fresh copy of the 1.6 squiggle?
>>
>> No.. but I'm not surprised. This is probably another JVM font issue
>> (I've had some in the past).
>>
>> Is that possibility consistent with what you know about how Batik handles
>> text with no explicit "font-family" ? What is the "default" font family?
>
>    The CSS engine will always provide a font-family.  The default font
> family comes from the 'CSSContext' which is implemented by the
> BridgeUserAgent in the JSVGComponent to return:
>      "Arial, Helvetica, sans-serif"

OK I tried playing with font-family="Arial, Helvetica, sans-serif"...

Turns out that "Helvetica" is the problem. If I remove it, it works.
Apparently I don't have an "Arial" because it doesn't matter whether
"Arial" is there in front of "Helvetica" or not.

Also, if "sans-serif" is first then it always works. That must be
the font I'm actually ending up with when it works (this is with
font-size="10" by the way).

Thanks,
-Archie

__________________________________________________________________________
Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]