Firefox don´s show very small font size

classic Classic list List threaded Threaded
19 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Firefox don´s show very small font size

Taciano Pinheiro
I need to use very small font size in text element into SVG, such as:
0.00638870000000000

But when the font size is very small, her is not showed

Somebody knows what it is occurring?

Thanks,

Taciano Pinheiro
_______________________________________________
dev-tech-svg mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-svg
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Firefox don´s show very small font size

Boris Zbarsky
Taciano Pinheiro wrote:
> Somebody knows what it is occurring?

You're asking the operating system for a font of that size.  The operating
system font subsystem rounds font sizes; in this case it rounds to 0.

-Boris
_______________________________________________
dev-tech-svg mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-svg
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Firefox don´s show very small font size

Boris Zbarsky
In reply to this post by Taciano Pinheiro
Taciano Pinheiro wrote:
> I need to use very small font size in text element into SVG, such as:
> 0.00638870000000000

Of course the real question here is why you think you need that....

-Boris
_______________________________________________
dev-tech-svg mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-svg
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Firefox don´s show very small font size

Taciano Pinheiro
On 6 jun, 19:45, Boris Zbarsky <[hidden email]> wrote:
> Taciano Pinheiro wrote:
> > I need to use very small font size in text element into SVG, such as:
> > 0.00638870000000000
>
> Of course the real question here is why you think you need that....
>
> -Boris

But in the Plugin Adobe SVG in Internet Explorer this font size
functions perfectly. I use this font size in a system of geographic
information to show the scale of a map in determined very high level
of zoom in.

_______________________________________________
dev-tech-svg mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-svg
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Firefox don´s show very small font size

Boris Zbarsky
Taciano Pinheiro wrote:
> But in the Plugin Adobe SVG in Internet Explorer this font size
> functions perfectly.

They might be doing something different in terms of the font they actually ask
the OS for.

> I use this font size in a system of geographic
> information to show the scale of a map in determined very high level
> of zoom in.

Seems like it would make more sense to take a reasonable font-size and then
scale it down in your SVG if you just want "really small text"...

-Boris
_______________________________________________
dev-tech-svg mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-svg
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Firefox don´s show very small font size

Robert O'Callahan-2
I don't know which version Taciano is testing, but in Firefox 3 if you
specify a miniscule font size and then scale it up a lot, we ask the
OS for the scaled font size only.

There is still a problem in the style system, which is that 'font-
size' is stored as an nscoord in appunits (1/60 of a CSS px). So 0.006
rounds down to 0 appunits :-(. The only way to fix this would be to
store the style data as unrounded floats... Even the far-off
conversion of nscoord to float wouldn't help since with that plan,
nscoords are still rounded to whole appunits.

Rob
_______________________________________________
dev-tech-svg mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-svg
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Firefox don´s show very small font size

Klaus Förster-2
In reply to this post by Boris Zbarsky
On 7 Jun., 00:45, Boris Zbarsky <[hidden email]> wrote:
> Taciano Pinheiro wrote:
> > I need to use very small font size in text element into SVG, such as:
> > 0.00638870000000000
>
> Of course the real question here is why you think you need that....
>
> -Boris

Maybe he's placing labels on a worldmap that uses geographic
coordinates within a viewbox?

-Klaus
_______________________________________________
dev-tech-svg mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-svg
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Firefox don´s show very small font size

Boris Zbarsky
Klaus Förster wrote:
> Maybe he's placing labels on a worldmap that uses geographic
> coordinates within a viewbox?

That doesn't answer my question.  One can use a reasonable-sized font and then
scale the text in the SVG to be very small...

-Boris

_______________________________________________
dev-tech-svg mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-svg
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Firefox don´s show very small font size

Klaus Förster-2
On 18 Jun., 17:22, Boris Zbarsky <[hidden email]> wrote:
> Klaus Förster wrote:
> > Maybe he's placing labels on a worldmap that uses geographic
> > coordinates within a viewbox?
>
> That doesn't answer my question.  One can use a reasonable-sized font and then
> scale the text in the SVG to be very small...
>
> -Boris

Isn't the font-size within the following example quite reasonable if
you want the text to be as big as the circle?

<svg xmlns="http://www.w3.org/2000/svg" viewBox="9.50227 -47.24023
0.10806 0.17379">
<title>Map of Liechtenstein</title>
 <rect x="9.5022" y="-47.24023" width="0.10806" height="0.17379"
fill="silver"/>
 <circle cx="9.52209" cy="-47.13935" r="0.002" />
 <text x="9.52209" y="-47.13935" font-size="0.004">Vaduz</text>
</svg>

The circle has a radius of 0.002 and is scaled up for display
according to the viewBox. That's what I would expect for the text as
well making a font-size of 0.0063887 completely valid. How should one
solve this issue with FF?

-Klaus
_______________________________________________
dev-tech-svg mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-svg
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Firefox don´s show very small font size

Boris Zbarsky
Klaus Förster wrote:
> Isn't the font-size within the following example quite reasonable

It depends on whether you actually want a "0.004px" font (with the right hinting
for that font size!) scaled to your bigger size, or whether you want something
readable.

Keep in mind that scaling a 6px font by a factor of 2 using an affine
transformation is NOT the same as using a 12px font.

-Boris
_______________________________________________
dev-tech-svg mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-svg
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Firefox don´s show very small font size

Klaus Förster-2
On 19 Jun., 17:48, Boris Zbarsky <[hidden email]> wrote:

> Klaus Förster wrote:
> > Isn't the font-size within the following example quite reasonable
>
> It depends on whether you actually want a "0.004px" font (with the right hinting
> for that font size!) scaled to your bigger size, or whether you want something
> readable.
>
> Keep in mind that scaling a 6px font by a factor of 2 using an affine
> transformation is NOT the same as using a 12px font.
>
> -Boris

according to section 7.10 Units (http://www.w3.org/TR/SVG/
coords.html#Units) within the SVG 1.1 specification "all coordinates
and lengths in SVG can be specified with or *without* a unit
identifier" and further on "when a coordinate or length value is a
number without a unit identifier (e.g., "25"), then the given
coordinate or length is assumed to be in user units (i.e., a value in
the current user coordinate system). For example: <text style="font-
size: 50">Text size is 50 user units</text>".

Doesn't this imply that the font-size="0.004" should *not* be
interpreted as "px" but rather as size hint within the established
viewPort? Is it impossible to "scale" a font-size in a similar way as
the circle radius? I'm not really into font-metrics math but I think
there should be a way to accomplish it - at least it's been done for
ASV3 as Taciano confirmed.

-Klaus
_______________________________________________
dev-tech-svg mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-svg
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Firefox don´s show very small font size

Ken Stacey
In reply to this post by Taciano Pinheiro
Boris Zbarsky wrote:

 > Keep in mind that scaling a 6px font by a factor of 2 using an affine
 > transformation is NOT the same as using a 12px font.

Like this ?

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 30">
  <text transform="translate(0,12) scale(12)" font-size="1">1px*12</text>
  <text transform="translate(0,25)" font-size="12">12px</text>
</svg>

The 1px font-size scaled by 12 looks the same as the 12px font-size.  As
you would expect.

It "shouldn't" matter what the font-size is nor the scaling.  The only
thing that matters is the font-size in initial viewPort coordinates (eg
screen pixels) after applying the CTM.  Then the viewing agent renders
that size.

There are limitations in Firefox - the viewPort font-size is rounded,
and there is the limit placed on nscoord (as described by Robert
O'Callahan earlier).

I think that Klaus' font-size is victim of the nscoord limit.  If you
just play with the font-size in Klaus' recent message, (using Firefox
2.0.0.14) the text is not rendered at 0.032, but is rendered at 0.033.

Klaus, is it unreasonable for you to multiply all your coordinates by 1000?

<svg xmlns="http://www.w3.org/2000/svg"
      viewBox="9502.27 -47240.23 108.06 0173.79">
<title>Map of Liechtenstein</title>
  <rect x="9502.2" y="-47240.23" width="108.06" height="173.79"
fill="silver"/>
  <circle cx="9522.09" cy="-47139.35" r="2" />
  <text x="9522.09" y="-47139.35" font-size="4">Vaduz</text>
</svg>

(I mistakenly sent this message to www-svg and got an informative reply
from Dr Olaf Hoffman.  He points out that the numbers in this example
where I blindly multiplied by 1000 are outside the number range for SVG
Tiny - '-32,767.9999 to +32,767.9999' )

Ken
_______________________________________________
dev-tech-svg mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-svg
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Firefox don´s show very small font size

Boris Zbarsky
In reply to this post by Taciano Pinheiro
Ken Stacey wrote:
> Like this ?
>
> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 30">
>  <text transform="translate(0,12) scale(12)" font-size="1">1px*12</text>
>  <text transform="translate(0,25)" font-size="12">12px</text>
> </svg>
>
> The 1px font-size scaled by 12 looks the same as the 12px font-size.  As
> you would expect.

As Robert said, we now scale before rendering.  That is, we do NOT scale
the font using an affine transformation.

> It "shouldn't" matter what the font-size is nor the scaling.  The only
> thing that matters is the font-size in initial viewPort coordinates (eg
> screen pixels) after applying the CTM.  Then the viewing agent renders
> that size.

That implies a non-affine transformation from the "specified" size, is
all.  Sure.

> I think that Klaus' font-size is victim of the nscoord limit.

Yep.

-Boris
_______________________________________________
dev-tech-svg mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-svg
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Firefox don´s show very small font size

Klaus Förster-2
On 20 Jun., 06:29, Boris Zbarsky <[hidden email]> wrote:

> Ken Stacey wrote:
> > Like this ?
>
> > <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 30">
> >  <text transform="translate(0,12) scale(12)" font-size="1">1px*12</text>
> >  <text transform="translate(0,25)" font-size="12">12px</text>
> > </svg>
>
> > The 1px font-size scaled by 12 looks the same as the 12px font-size.  As
> > you would expect.
>
> As Robert said, we now scale before rendering.  That is, we do NOT scale
> the font using an affine transformation.
>
> > It "shouldn't" matter what the font-size is nor the scaling.  The only
> > thing that matters is the font-size in initial viewPort coordinates (eg
> > screen pixels) after applying the CTM.  Then the viewing agent renders
> > that size.
>
> That implies a non-affine transformation from the "specified" size, is
> all.  Sure.
>
> > I think that Klaus' font-size is victim of the nscoord limit.
>
> Yep.
>
will the victim be released from jail in FF 3.1?

-Klaus
_______________________________________________
dev-tech-svg mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-svg
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Firefox don´s show very small font size

Boris Zbarsky
Klaus Förster wrote:
> will the victim be released from jail in FF 3.1?

You mean, will we do a complete rewrite of all code that works with
coordinates?

Unlikely.

-Boris
_______________________________________________
dev-tech-svg mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-svg
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Firefox don´s show very small font size

Klaus Förster-2
On 20 Jun., 23:29, Boris Zbarsky <[hidden email]> wrote:
> Klaus Förster wrote:
> > will the victim be released from jail in FF 3.1?
>
> You mean, will we do a complete rewrite of all code that works with
> coordinates?
>
> Unlikely.
>
> -Boris

Of course you won't rewrite all of the code and I didn't intend to ask
you to do so ;-)

font-size within SVG is special as it may be affected by a viewBox.
Are there any changes to handle this extra step as well?

-Klaus
_______________________________________________
dev-tech-svg mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-svg
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Firefox don´s show very small font size

Chris Lilley
In reply to this post by Boris Zbarsky
On Thursday, June 19, 2008, 5:48:59 PM, Boris wrote:

BZ> Klaus Förster wrote:
>> Isn't the font-size within the following example quite reasonable

BZ> It depends on whether you actually want a "0.004px" font (with the right hinting
BZ> for that font size!) scaled to your bigger size, or whether you want something
BZ> readable.

The example didn't say a font size of "0.004px". It said a font size of "0.004" in the current local coordinate system.

Lets give that example an actual physical size as well for the purposes of discussion. Slightly odd sizes used for simplicity to calculate the scale value. (I note in passing that using degrees of latitude and longitude as a coordinate system, which this example does, is fairly common for large scale maps).

<svg xmlns="http://www.w3.org/2000/svg" viewBox="9.50227
-47.24023 0.10806 0.17379" width="10.806in" height="17.379in">
<title>Map of Liechtenstein</title>
 <rect x="9.5022" y="-47.24023" width="0.10806" height="0.17379"
fill="silver"/>
 <circle cx="9.52209" cy="-47.13935" r="0.002" />
 <text x="9.52209" y="-47.13935" font-size="0.004">Vaduz</text>
</svg>

So a font-size of 0.004 in that coordinate system comes out at 0.4 inches (28.8pt, or 10.16mm).


BZ> Keep in mind that scaling a 6px font by a factor of 2 using an affine
BZ> transformation is NOT the same as using a 12px font.

Affine transformations are hopefully applied to vector geometry, not to rasterised results. Otherwise there are going to be some blurry, blocky renderings.


--
 Chris Lilley                    mailto:[hidden email]
 Interaction Domain Leader
 W3C Graphics Activity Lead
 Co-Chair, W3C Hypertext CG

_______________________________________________
dev-tech-svg mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-svg
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Firefox don´s show very small font size

Robert O'Callahan-2
In reply to this post by Boris Zbarsky
On Jun 21, 9:29 am, Boris Zbarsky <[hidden email]> wrote:
> Klaus Förster wrote:
> > will the victim be released from jail in FF 3.1?
>
> You mean, will we do a complete rewrite of all code that works with
> coordinates?
>
> Unlikely.

Conceivably we could just change font-size in the style system to use
float instead of nscoord. It might not even be that hard.

Rob
_______________________________________________
dev-tech-svg mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-svg
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Firefox don´s show very small font size

sebastien.beal
Does this has been fixed or there is maybe a workaround I missed? I have a similar issue with my svg text of font-size < 0.01px well displaying in Chrome, Safari and IE but not Firefox.

On Tuesday, June 24, 2008 12:19:21 PM UTC+9, [hidden email] wrote:

> On Jun 21, 9:29 am, Boris Zbarsky <[hidden email]> wrote:
> > Klaus Förster wrote:
> > > will the victim be released from jail in FF 3.1?
> >
> > You mean, will we do a complete rewrite of all code that works with
> > coordinates?
> >
> > Unlikely.
>
> Conceivably we could just change font-size in the style system to use
> float instead of nscoord. It might not even be that hard.
>
> Rob

_______________________________________________
dev-tech-svg mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-svg
Loading...