Closed Bug 78273 Opened 23 years ago Closed 23 years ago

Embedding API: list avail fonts

Categories

(Core :: Internationalization, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla0.9.2

People

(Reporter: bstell, Assigned: bstell)

References

Details

Attachments

(3 files)

Applications embedding gecko need the list of available fonts for a given
language group so users can set the fallback preferences.
QA Contact: andreasb → teruko
Thanks for pointing out the existing API.

The embedding effort has requested some slight changes:

  return a nsISimpleEnumerator instead of an array of strings.

  simpilify as much as possible
   - we can make EnumerateAllFonts a sub case of EnumerateFonts
     by passing in a null aLangGroup and aGeneric
   - we can eliminate HaveFontFor.


(the new API actually calls nsIFontEnumerator.
Status: NEW → ASSIGNED
Blocks: 65898
Target Milestone: --- → mozilla0.9.1
Whiteboard: patch waiting on platform buddy review (via email)
who is reviewing this ?
TM to 0.9.2 per PDT triage (it's OK to check it in by Friday or after 0.9.2 branch).
Target Milestone: mozilla0.9.1 → mozilla0.9.2
need nsSetupRegistry.cpp change on mac
also, we should call hasMoreElements in js first before we call getNext.
Please change 
+          while ((fontName = aDataObject.getNext()) != null) {
+            fontName = 
fontName.QueryInterface(Components.interfaces.nsISupportsWString);
to 
+          while (aDataObject.hasMoreElements()) {
+            fontName = aDataObject.getNext();
+            fontName = 
fontName.QueryInterface(Components.interfaces.nsISupportsWString);

otherwise, it won't run on mac.
please change according to my comment. we also need to check in mac project file 
for the IDL and nsFontList.cpp . please ask jbetak to review pref-fonts.js 
changes. for the rest, r=ftang
r=jbetak for the JS part of the patch
additional comment: please try to eliminate all dumps you can spare
I'll remove the 

 dump("got font list, "+fileName+" "+lineNum+"\n");

but ftang specifically ask me to add the dump in the exception

 catch(e)
   {
+    dump("failed to get font list or pref object: "+e+", "+fileName+" 
"+lineNum+"\n");
   }
What is the lang group exactly?  Can you expand this comment with examples as well?

+   * @param aLangGroup limits the fonts to fonts in this language 
+   *          group.

+    return NS_ERROR_UNEXPECTED;;

two semicolons?  legal but odd. :)

Fix those and you have an sr=blizzard
checked in
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Whiteboard: patch waiting on platform buddy review (via email)
nsIFontList API is there.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: