Closed
Bug 166773
Opened 23 years ago
Closed 23 years ago
rearrange the code of FreeType2 Font Catalog under mozilla/gfx/src/x11shared
Categories
(Core :: Printing: Output, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: Louie.Zhao, Assigned: Louie.Zhao)
References
Details
Attachments
(15 files, 3 obsolete files)
The code under gfx/src/x11shared are shared by gtk, xlib module. Some of them
are independent on gtk(xlib)module (e.g. nsFreeType & FT2 Font Catalog) and some
of them are not(e.g. nsFreeTypeFont). The two parts should be placed seperately,
but unfortunately, they are messed altogether.
The design should be:
1. class nsFreeType: wrapper of FT2 function and library, no relation to gtk
module, placed in nsFreeType.cpp(h)
2. class nsFT2FontCatalog: implement getting FT2 Font Catalog, return Font
Catalog Entry. no relation to gtk module, placed nsFT2FontCatalog.cpp(h).
3. class nsFT2FontNode: newly created class. Convert Font Catalog Entry
collection to nsFontNode(defined and usedy by gtk-module) array. Originally be
part of nsFT2FontCatalog, placed in nsFT2FontNode.cpp(h). gtk-module related.
4. class nsFreeTypeFont: derived class of nsFontGTK, remove from
nsFreeType.cpp(h) to nsFontFreeType.cpp(h), gtk-module related.
This is a preparing work for bug 144664 (Font Catalog Service)
Assignee | ||
Comment 1•23 years ago
|
||
Assignee | ||
Comment 2•23 years ago
|
||
Brian's comments about the first proposed patch.
Assignee | ||
Comment 4•23 years ago
|
||
This is a brief introduction of this patch, hope it can help review and
super-review.
FreeType2-related part under gfx/src/x11shared mainly use FreeTyp2 function to
get font entry(s) and font glyph(s) from font file. These font entry(s) and
glyph(s) are used by other module, e.g. gfx/src/gtk. Some of these code are
FreeType2-related only, but some is gtk-module-related. So this patch mainly
seperates gtk-module-related part from gtk-module-unrelated part of these code
in mozilla/gfx/src/x11shared.
The motivation of this action is due to bug 144664 (Font Catalog Service). FCS
take search pattern (string) and return matching collection of font catalog
entry (fce).The service has no relation to any other module like gtk. Though the
original code has this functionality, such code has been messed up with other
gtk-module-related part. Rewritting the whole Font Catalog Service will make the
patch large and hard to (super)review. Then our solution is to
1. rearrange (part of) the gfx/src/x11shared code.
2. using existing code to implement Font Catalog Service.
Rearranging code mainly includes following items:
1.nsFreeType.cpp(h): This file include 2 classes - nsFreeType and
nsFreeTypeFont. nsFreeType is wrapper of FreeType2 library and function.
nsFreeTyepFont use function provided by nsFreeType to get font glyph.
nsFreeTypeFont is derived from nsFontGTK (belong to gtk module). So
nsFreeTypeFont must be seperated.I put nsFreeTypeFont in new file
nsFontFreeType.cpp(h), and leave gtk-unrelated part - nsFreeType in
nsFreeType.cpp(h).
2.nsFT2FontCatalog.cpp(h): This file include 1 class - nsFT2FontCatalog. It use
searching pattern to look for matching fce collection (what FCS should do), and
then convert fce to nsFontNode and return nsFontNode collection. nsFontNode is
defined in gtk module. I devided nsFT2FontCatalog into 2 parts.
A.nsFT2FontCatalog (still the name): use searching pattern to look for
matching fce collection
B.nsFT2FontNode : use nsFT2FontCatalog to get matching fce collection, then
convert to nsFontNode collection.
After these rearranging, nsFreeType and nsFT2FontCatalog are gtk-unrelated, and
can be wrapped to be Font Catalog Service later. nsFT2FontNode and
nsFreeTypeFont will use nsFreeType and nsFT2FontCatalog to provide things needed
by gtk module.
3.About Debug: Debugging code of font is placed in
gfx/src/gtk/nsFontMetricsGTK.h, there debugging code are used by gtk module and
x11shared, so I move them into x11shared/nsFontDebug.h, thus can be shared by
other module.
Comment 5•23 years ago
|
||
Roland: please take a look at this. We are reorganizing as a first step before
starting the truetype printing work.
Assignee | ||
Comment 6•23 years ago
|
||
refined patch following Brian's suggestion (mainly add "moving some reading
preference code from nsFontMetricsGTK to nsFreeType")
Attachment #98575 -
Attachment is obsolete: true
Assignee | ||
Comment 7•23 years ago
|
||
Assignee | ||
Comment 8•23 years ago
|
||
Hope this detailed description of what the patch had done can help
(super)viewer to look through the patch(attachment 98877 [details] [diff] [review]).
Attachment #99014 -
Attachment is obsolete: true
Comment 9•23 years ago
|
||
Comment 10•23 years ago
|
||
Comment 11•23 years ago
|
||
Comment 12•23 years ago
|
||
Comment 13•23 years ago
|
||
Comment 14•23 years ago
|
||
Comment 15•23 years ago
|
||
Comment 16•23 years ago
|
||
Comment 17•23 years ago
|
||
Comment 18•23 years ago
|
||
Comment 19•23 years ago
|
||
Comment 20•23 years ago
|
||
Comment 21•23 years ago
|
||
Because the patch (attachment 98877 [details] [diff] [review]) is long (~3700 lines) I have broken it down
into individual file patches so we can spread the super-review effort over more
than one person.
Updated•23 years ago
|
Attachment #99116 -
Flags: review+
Updated•23 years ago
|
Attachment #99117 -
Flags: review+
Updated•23 years ago
|
Attachment #99118 -
Flags: review+
Updated•23 years ago
|
Attachment #99119 -
Flags: review+
Updated•23 years ago
|
Attachment #99120 -
Flags: review+
Updated•23 years ago
|
Attachment #99121 -
Flags: review+
Updated•23 years ago
|
Attachment #99122 -
Flags: review+
Updated•23 years ago
|
Attachment #99123 -
Flags: review+
Updated•23 years ago
|
Attachment #99125 -
Flags: review+
Updated•23 years ago
|
Attachment #99128 -
Flags: review+
Updated•23 years ago
|
Attachment #99126 -
Flags: review+
Updated•23 years ago
|
Attachment #99124 -
Flags: review+
Comment 22•23 years ago
|
||
r=bstell@ix.netcom.com for attachment
r=bstell@ix.netcom.com for attachment 99116 [details] [diff] [review]
r=bstell@ix.netcom.com for attachment 99117 [details] [diff] [review]
r=bstell@ix.netcom.com for attachment 99118 [details] [diff] [review]
r=bstell@ix.netcom.com for attachment 99119 [details] [diff] [review]
r=bstell@ix.netcom.com for attachment 99120 [details] [diff] [review]
r=bstell@ix.netcom.com for attachment 99121 [details] [diff] [review]
r=bstell@ix.netcom.com for attachment 99122 [details] [diff] [review]
r=bstell@ix.netcom.com for attachment 99123 [details] [diff] [review]
r=bstell@ix.netcom.com for attachment 99124 [details] [diff] [review]
r=bstell@ix.netcom.com for attachment 99125 [details] [diff] [review]
r=bstell@ix.netcom.com for attachment 99126 [details] [diff] [review]
r=bstell@ix.netcom.com for attachment 99128 [details] [diff] [review]
Comment 23•23 years ago
|
||
the changes are basically:
attachment 99126 [details] [diff] [review] : nsFreeType.cpp
attachment 99128 [details] [diff] [review] : nsFreeType.h
attachment 99124 [details] [diff] [review] : nsFontFreeType.cpp
attachment 99125 [details] [diff] [review] : nsFontFreeType.h
attachment 99117 [details] [diff] [review] : nsFontMetricsGTK.cpp
The class nsFreeTypeFont is split into the part the interacts with
the FreeType2 library (nsFreeType) and the part that measures/renders
TrueType glyphs (nsFontFreeType). The nsFontFreeType code is moved to
nsFontFreeType.cpp/h
FreeType pref values are moved from nsFontMetricsGTK.cpp to nsFreeType.cpp
The weight correction table is moved to nsFT2FontNode
attachment 99116 [details] [diff] [review] : gtk/Makefile.in
nsFontFreeType.cpp and nsFT2FontNode.cpp are added to list of *.cpp files
attachment 99118 [details] [diff] [review] : nsFontMetricsGTK.h
attachment 99123 [details] [diff] [review] : nsFontDebug.h
separate the font debug macros from nsFontMetricsGTK.h
Comment 24•23 years ago
|
||
Comment on attachment 99117 [details] [diff] [review]
patch for gtk/nsFontMetricsGTK.cpp
sr=jst
Attachment #99117 -
Flags: superreview+
Comment 25•23 years ago
|
||
Comment on attachment 99116 [details] [diff] [review]
patch for gtk/Makefile.in
+ nsFT2FontNode.cpp \
nsFT2FontCatalog.cpp \
nsX11AlphaBlend.cpp \
nsXFontAAScaledBitmap.cpp \
Looks like we have some inconsistent indentation in this makefile, please clean
this up when checking in.
sr=jst
Attachment #99116 -
Flags: superreview+
Updated•23 years ago
|
Attachment #99118 -
Flags: superreview+
Comment 26•23 years ago
|
||
Comment on attachment 99119 [details] [diff] [review]
patch for x11shared/nsFT2FontCatalog.cpp
sr=jst
Attachment #99119 -
Flags: superreview+
Updated•23 years ago
|
Attachment #99120 -
Flags: superreview+
Updated•23 years ago
|
Attachment #99121 -
Flags: superreview+
Updated•23 years ago
|
Attachment #99122 -
Flags: superreview+
Comment 27•23 years ago
|
||
Comment on attachment 99123 [details] [diff] [review]
patch for x11shared/nsFontDebug.h
...
+#define NS_FONT_DEBUG_FIND_FONT 0x04
+#define NS_FONT_DEBUG_SIZE_FONT 0x08
+#define NS_FONT_DEBUG_SCALED_FONT 0x10
+#define NS_FONT_DEBUG_BANNED_FONT 0x20
...
Maybe indent the values before 0x10 to line up with the rest?
sr=jst
Attachment #99123 -
Flags: superreview+
Updated•23 years ago
|
Attachment #99124 -
Flags: superreview+
Comment 28•23 years ago
|
||
Comment on attachment 99125 [details] [diff] [review]
patch for x11shared/nsFontFreeType.h
+#ifndef MAX
+#define MAX(a,b) ((a) > (b) ? (a) : (b))
+#endif
+#ifndef MIN
+#define MIN(a,b) ((a) < (b) ? (a) : (b))
+#endif
Nspr already defines PR_MAX() and PR_MIN(), can't those be used here too, or is
there a reason to duplicate those macros here?
sr=jst
Attachment #99125 -
Flags: superreview+
Updated•23 years ago
|
Attachment #99126 -
Flags: superreview+
Comment 29•23 years ago
|
||
Comment on attachment 99128 [details] [diff] [review]
patch for x11shared/nsFreeType.h
- In nsFreeType.h:
+#ifndef MAX
+#define MAX(a,b) ((a) > (b) ? (a) : (b))
+#endif
+#ifndef MIN
+#define MIN(a,b) ((a) < (b) ? (a) : (b))
+#endif
Same here, PR_MAX()/PR_MIN()?
sr=jst
Attachment #99128 -
Flags: superreview+
Comment 30•23 years ago
|
||
With those comments, sr=jst for the whole thing.
Assignee | ||
Comment 31•23 years ago
|
||
checked in trunk by pete.zha@sun.com
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•