Embedding API: list avail fonts

VERIFIED FIXED in mozilla0.9.2

Status

()

Core
Internationalization
VERIFIED FIXED
17 years ago
16 years ago

People

(Reporter: kill this account, Assigned: kill this account)

Tracking

Trunk
mozilla0.9.2
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

(Assignee)

Description

17 years ago
Applications embedding gecko need the list of available fonts for a given
language group so users can set the fallback preferences.

Updated

17 years ago
QA Contact: andreasb → teruko

Comment 1

17 years ago
http://lxr.mozilla.org/seamonkey/source/gfx/idl/nsIFontEnumerator.idl
(Assignee)

Comment 2

17 years ago
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
(Assignee)

Updated

17 years ago
Blocks: 65898
(Assignee)

Updated

17 years ago
Target Milestone: --- → mozilla0.9.1
(Assignee)

Updated

17 years ago
Whiteboard: patch waiting on platform buddy review (via email)

Comment 3

17 years ago
who is reviewing this ?

Comment 4

17 years ago
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
(Assignee)

Comment 5

17 years ago
Created attachment 34886 [details] [diff] [review]
patch with new font prefs API

Comment 6

17 years ago
need nsSetupRegistry.cpp change on mac
also, we should call hasMoreElements in js first before we call getNext.

Comment 7

17 years ago
Created attachment 35052 [details] [diff] [review]
nsSetupRegistry.cpp changes needed for mac

Comment 8

17 years ago
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.
(Assignee)

Comment 9

17 years ago
Created attachment 35081 [details] [diff] [review]
patch with win/mac build changes

Comment 10

17 years ago
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
(Assignee)

Comment 13

17 years ago
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
(Assignee)

Comment 15

17 years ago
checked in
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED
Whiteboard: patch waiting on platform buddy review (via email)

Comment 16

16 years ago
nsIFontList API is there.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.