[Project_owners] System Fonts

Shivanand Sharma varun21 at gmail.com
Mon Jun 15 06:44:27 PDT 2009


If you work in "em"s this may be a piece of cake. For e.g. 1em is the
default font size (irrespective of pixels or whatever OS or user setting. If
the user has chosen the default font to be 14px then 1em = 14px). and a
width or 1 em will be the size of the letter "m" (in the default font/size).
Not an expert in typography but read this for more
http://jontangerine.com/log/2007/09/the-incredible-em-and-elastic-layouts-with-css.
Either ways reading that article is a must for any web programmer/developer.

Hope this helps.

Regards,
Shivanand Sharma
Producer and Editor
BinaryTurf.Com <http://www.binaryturf.com> (Web Technology & Blogging)
AdvancedPhotography.Net <http://www.advancedphotography.net> (Digital
Photography)



On Mon, Jun 15, 2009 at 2:24 PM, Neil <neil at parkwaycc.co.uk> wrote:

> Joe Brochu wrote:
>
>  I am looking for an easy way to get system fonts and sizes for explicitly
>> setting box sizes within a stack to dynamically accommodate various native
>> OS's.  Are there any shortcuts or global variables available within the
>> Mozilla framework to reference this information?
>>
>> I could probably create a piece of dummy text with no formatting and get
>> numbers from there, but I'm hoping for something more elegant.  I also don't
>> want to redraw everything 3 times!
>>
>
> It's not clear what you're trying to do, but maybe you could add an extra
> layer to your stack (but with visibility: hidden; so that it doesn't paint)
> that includes your dummy text which will cause it to be the correct size.
>
>  I could also use something similar for getting scrollbar widths.
>>
>
> Perhaps you could include a xul:scrollbar element in your document and
> measure that?
>
> _______________________________________________
> Project_owners mailing list
> Project_owners at mozdev.org
> https://www.mozdev.org/mailman/listinfo/project_owners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mozdev.org/pipermail/project_owners/attachments/20090615/c196b7fb/attachment.html>


More information about the Project_owners mailing list