srivani wrote:
> Is there any API that I can use on text nodes(of type nsITextContent)
> to get the associated font-family info)?

In addition to what Eli wrote, I'd point out two things:

1) text nodes always have the same style data as their parent element. 
In terms of the internal GetStyleData() API, you can get the relevant 
style data from either.  In terms of the public/frozen GetComputedStyle 
API, you can get it only from the parent element node.  But it's the 
same either way.

2) These APIs tell you only what the specified font is; they don't tell 
you which fonts were actually used.  (Font selection is effectively 
character-by-character, using the list of fonts in the 'font-family' 
property.  The first font in the list that is present on the system and 
has the character will be used for that character.  But we don't 
currently have any API that gives you that information; if we did it 
would be useful for other things, though.)

-David

-- 
L. David Baron                                <URL: http://dbaron.org/ >
            Technical Lead, Layout & CSS, Mozilla Corporation
_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout

Reply via email to