This build of SeaMonkey for OS/2 was made from code in mozilla-central and comm-central dated 2008-08-06 11:00. But the build could only be completed by adding the build patch pasted below that was only pushed to mozilla-central a few hours later. ================================================================================ diff --git a/gfx/thebes/public/gfxOS2Fonts.h b/gfx/thebes/public/gfxOS2Fonts.h --- a/gfx/thebes/public/gfxOS2Fonts.h +++ b/gfx/thebes/public/gfxOS2Fonts.h @@ -46,19 +46,25 @@ #define INCL_GPI #include #include #include "cairo-ft.h" // includes fontconfig.h, too #include #include "nsICharsetConverterManager.h" +class gfxOS2FontEntry : public gfxFontEntry { +public: + gfxOS2FontEntry(const nsAString& aName) : gfxFontEntry(aName) {} + ~gfxOS2FontEntry() {} +}; + class gfxOS2Font : public gfxFont { public: - gfxOS2Font(const nsAString &aName, const gfxFontStyle *aFontStyle); + gfxOS2Font(gfxOS2FontEntry *aFontEntry, const gfxFontStyle *aFontStyle); virtual ~gfxOS2Font(); virtual const gfxFont::Metrics& GetMetrics(); cairo_font_face_t *CairoFontFace(); cairo_scaled_font_t *CairoScaledFont(); virtual nsString GetUniqueName(); diff --git a/gfx/thebes/src/gfxOS2Fonts.cpp b/gfx/thebes/src/gfxOS2Fonts.cpp --- a/gfx/thebes/src/gfxOS2Fonts.cpp +++ b/gfx/thebes/src/gfxOS2Fonts.cpp @@ -49,18 +49,18 @@ #include "nsIPlatformCharset.h" #include "nsIPrefBranch.h" #include "nsIPrefService.h" /********************************************************************** * class gfxOS2Font **********************************************************************/ -gfxOS2Font::gfxOS2Font(const nsAString &aName, const gfxFontStyle *aFontStyle) - : gfxFont(aName, aFontStyle), +gfxOS2Font::gfxOS2Font(gfxOS2FontEntry *aFontEntry, const gfxFontStyle *aFontStyle) + : gfxFont(aFontEntry, aFontStyle), mFontFace(nsnull), mScaledFont(nsnull), mMetrics(nsnull), mAdjustedSize(0), mHinting(FC_HINT_MEDIUM), mAntialias(FcTrue) { #ifdef DEBUG_thebes_2 printf("gfxOS2Font[%#x]::gfxOS2Font(\"%s\", aFontStyle)\n", (unsigned)this, NS_LossyConvertUTF16toASCII(aName).get()); #endif @@ -226,17 +226,17 @@ const gfxFont::Metrics& gfxOS2Font::GetM " emHeight=%f == %f=gfxFont::style.size == %f=adjSz\n" " maxHeight=%f xHeight=%f\n" " aveCharWidth=%f==xWidth spaceWidth=%f\n" " supOff=%f SubOff=%f strOff=%f strSz=%f\n" " undOff=%f undSz=%f intLead=%f extLead=%f\n" " emAsc=%f emDesc=%f maxH=%f\n" " maxAsc=%f maxDes=%f maxAdv=%f\n", (unsigned)this, - NS_LossyConvertUTF16toASCII(mName).get(), + NS_LossyConvertUTF16toASCII(GetName()).get(), os2 && os2->version != 0xFFFF ? "has OS/2 table" : "no OS/2 table!", mMetrics->emHeight, GetStyle()->size, mAdjustedSize, mMetrics->maxHeight, mMetrics->xHeight, mMetrics->aveCharWidth, mMetrics->spaceWidth, mMetrics->superscriptOffset, mMetrics->subscriptOffset, mMetrics->strikeoutOffset, mMetrics->strikeoutSize, mMetrics->underlineOffset, mMetrics->underlineSize, mMetrics->internalLeading, mMetrics->externalLeading, @@ -272,24 +272,24 @@ cairo_font_face_t *gfxOS2Font::CairoFont cairo_font_face_t *gfxOS2Font::CairoFontFace() { #ifdef DEBUG_thebes_2 printf("gfxOS2Font[%#x]::CairoFontFace()\n", (unsigned)this); #endif if (!mFontFace) { #ifdef DEBUG_thebes printf("gfxOS2Font[%#x]::CairoFontFace(): create it for %s, %f\n", - (unsigned)this, NS_LossyConvertUTF16toASCII(mName).get(), GetStyle()->size); + (unsigned)this, NS_LossyConvertUTF16toASCII(GetName()).get(), GetStyle()->size); #endif FcPattern *fcPattern = FcPatternCreate(); // add (family) name to pattern // (the conversion should work, font names don't contain high bit chars) FcPatternAddString(fcPattern, FC_FAMILY, - (FcChar8 *)NS_LossyConvertUTF16toASCII(mName).get()); + (FcChar8 *)NS_LossyConvertUTF16toASCII(GetName()).get()); // adjust font weight using the offset // The requirements outlined in gfxFont.h are difficult to meet without // having a table of available font weights, so we map the gfxFont // weight to possible FontConfig weights. PRInt8 weight, offset; GetStyle()->ComputeWeightAndOffset(&weight, &offset); // gfxFont weight FC weight @@ -343,24 +343,24 @@ cairo_font_face_t *gfxOS2Font::CairoFont FcPatternGetInteger(fcPattern, FC_WEIGHT, 0, &w1); FcPatternGetInteger(fcPattern, FC_SLANT, 0, &i1); FcPatternGetDouble(fcPattern, FC_PIXEL_SIZE, 0, &s1); FcPatternGetString(fcMatch, FC_FAMILY, 0, &str2); FcPatternGetInteger(fcMatch, FC_WEIGHT, 0, &w2); FcPatternGetInteger(fcMatch, FC_SLANT, 0, &i2); FcPatternGetDouble(fcMatch, FC_PIXEL_SIZE, 0, &s2); printf(" input=%s,%d,%d,%f\n fcPattern=%s,%d,%d,%f\n fcMatch=%s,%d,%d,%f\n", - NS_LossyConvertUTF16toASCII(mName).get(), + NS_LossyConvertUTF16toASCII(GetName()).get(), GetStyle()->weight, GetStyle()->style, GetStyle()->size, (char *)str1, w1, i1, s1, (char *)str2, w2, i2, s2); #endif FcPatternDestroy(fcPattern); - if (mName == NS_LITERAL_STRING("Workplace Sans") && fcW >= FC_WEIGHT_DEMIBOLD) { + if (GetName() == NS_LITERAL_STRING("Workplace Sans") && fcW >= FC_WEIGHT_DEMIBOLD) { // if we are dealing with Workplace Sans and want a bold font, we // need to artificially embolden it (no bold counterpart yet) FcPatternAddBool(fcMatch, FC_EMBOLDEN, FcTrue); } else { // if we don't embolden, we can possibly switch off antialiasing FcPatternAddBool(fcMatch, FC_ANTIALIAS, mAntialias); } FcPatternAddInteger(fcMatch, FC_HINT_STYLE, mHinting); @@ -378,17 +378,17 @@ cairo_scaled_font_t *gfxOS2Font::CairoSc cairo_scaled_font_t *gfxOS2Font::CairoScaledFont() { #ifdef DEBUG_thebes_2 printf("gfxOS2Font[%#x]::CairoScaledFont()\n", (unsigned)this); #endif if (!mScaledFont) { #ifdef DEBUG_thebes_2 printf("gfxOS2Font[%#x]::CairoScaledFont(): create it for %s, %f\n", - (unsigned)this, NS_LossyConvertUTF16toASCII(mName).get(), GetStyle()->size); + (unsigned)this, NS_LossyConvertUTF16toASCII(GetName()).get(), GetStyle()->size); #endif double size = mAdjustedSize ? mAdjustedSize : GetStyle()->size; cairo_matrix_t fontMatrix; cairo_matrix_init_scale(&fontMatrix, size, size); cairo_font_options_t *fontOptions = cairo_font_options_create(); mScaledFont = cairo_scaled_font_create(CairoFontFace(), &fontMatrix, reinterpret_cast(&mCTM), @@ -399,22 +399,22 @@ cairo_scaled_font_t *gfxOS2Font::CairoSc NS_ASSERTION(cairo_scaled_font_status(mScaledFont) == CAIRO_STATUS_SUCCESS, "Failed to make scaled font"); return mScaledFont; } nsString gfxOS2Font::GetUniqueName() { #ifdef DEBUG_thebes - printf("gfxOS2Font::GetUniqueName()=%s\n", (char *)mName.get()); + printf("gfxOS2Font::GetUniqueName()=%s\n", (char *)GetName().get()); #endif - // gfxFont::mName should already be unique enough + // gfxFont::GetName() should already be unique enough // Atsui uses that, too, while Win appends size, and properties... // doesn't seem to get called at all anyway - return mName; + return GetName(); } PRBool gfxOS2Font::SetupCairoFont(gfxContext *aContext) { #ifdef DEBUG_thebes_2 printf("gfxOS2Font[%#x]::SetupCairoFont(%#x)\n", (unsigned)this, (unsigned) aContext); #endif @@ -436,17 +436,18 @@ PRBool gfxOS2Font::SetupCairoFont(gfxCon * In either case, add a ref and return it --- * except for OOM in which case we do nothing and return null. */ already_AddRefed gfxOS2Font::GetOrMakeFont(const nsAString& aName, const gfxFontStyle *aStyle) { nsRefPtr font = gfxFontCache::GetCache()->Lookup(aName, aStyle); if (!font) { - font = new gfxOS2Font(aName, aStyle); + nsRefPtr fe = new gfxOS2FontEntry(aName); + font = new gfxOS2Font(fe, aStyle); if (!font) return nsnull; gfxFontCache::GetCache()->AddNew(font); } gfxFont *f = nsnull; font.swap(f); return static_cast(f); }