mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
Bug 1452973 - Update NS_FONT_STRETCH_* constants to values based on the percentage definitions in css fonts 4. r=jwatt
This commit is contained in:
parent
4faa99b475
commit
94238d9823
@ -93,7 +93,7 @@ DoGrayscale(IDWriteFontFace *aDWFace, Float ppem)
|
||||
}
|
||||
|
||||
static inline DWRITE_FONT_STRETCH
|
||||
DWriteFontStretchFromStretch(int16_t aStretch)
|
||||
DWriteFontStretchFromStretch(uint16_t aStretch)
|
||||
{
|
||||
switch (aStretch) {
|
||||
case NS_FONT_STRETCH_ULTRA_CONDENSED:
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include <dwrite.h>
|
||||
|
||||
static inline DWRITE_FONT_STRETCH
|
||||
DWriteFontStretchFromStretch(int16_t aStretch)
|
||||
DWriteFontStretchFromStretch(uint16_t aStretch)
|
||||
{
|
||||
switch (aStretch) {
|
||||
case NS_FONT_STRETCH_ULTRA_CONDENSED:
|
||||
@ -47,8 +47,8 @@ DWriteFontStretchFromStretch(int16_t aStretch)
|
||||
}
|
||||
}
|
||||
|
||||
static inline int16_t
|
||||
FontStretchFromDWriteStretch(DWRITE_FONT_STRETCH aStretch)
|
||||
static inline uint16_t
|
||||
FontStretchFromDWriteStretch(DWRITE_FONT_STRETCH aStretch)
|
||||
{
|
||||
switch (aStretch) {
|
||||
case DWRITE_FONT_STRETCH_ULTRA_CONDENSED:
|
||||
|
@ -958,7 +958,7 @@ gfxDWriteFontList::GetDefaultFontForPlatform(const gfxFontStyle *aStyle)
|
||||
gfxFontEntry *
|
||||
gfxDWriteFontList::LookupLocalFont(const nsAString& aFontName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle)
|
||||
{
|
||||
gfxFontEntry *lookup;
|
||||
@ -982,7 +982,7 @@ gfxDWriteFontList::LookupLocalFont(const nsAString& aFontName,
|
||||
gfxFontEntry *
|
||||
gfxDWriteFontList::MakePlatformFont(const nsAString& aFontName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength)
|
||||
|
@ -141,7 +141,7 @@ public:
|
||||
gfxDWriteFontEntry(const nsAString& aFaceName,
|
||||
IDWriteFont *aFont,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle)
|
||||
: gfxFontEntry(aFaceName), mFont(aFont), mFontFile(nullptr),
|
||||
mIsSystemFont(false), mForceGDIClassic(false),
|
||||
@ -168,7 +168,7 @@ public:
|
||||
IDWriteFontFile *aFontFile,
|
||||
IDWriteFontFileStream *aFontFileStream,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle)
|
||||
: gfxFontEntry(aFaceName), mFont(nullptr),
|
||||
mFontFile(aFontFile), mFontFileStream(aFontFileStream),
|
||||
@ -405,12 +405,12 @@ public:
|
||||
|
||||
virtual gfxFontEntry* LookupLocalFont(const nsAString& aFontName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle);
|
||||
|
||||
virtual gfxFontEntry* MakePlatformFont(const nsAString& aFontName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength);
|
||||
|
@ -258,7 +258,7 @@ FT2FontEntry::CreateFontInstance(const gfxFontStyle *aFontStyle, bool aNeedsBold
|
||||
FT2FontEntry*
|
||||
FT2FontEntry::CreateFontEntry(const nsAString& aFontName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength)
|
||||
@ -968,7 +968,7 @@ gfxFT2FontList::AppendFacesFromCachedFaceList(
|
||||
if (!(end = strchr(beginning, ','))) {
|
||||
break;
|
||||
}
|
||||
int32_t stretch = strtol(beginning, nullptr, 10);
|
||||
uint32_t stretch = strtoul(beginning, nullptr, 10);
|
||||
|
||||
FontListEntry fle(familyName, faceName, aFileName,
|
||||
weight, stretch, italic, index);
|
||||
@ -1465,7 +1465,7 @@ gfxFT2FontList::InitFontListForPlatform()
|
||||
gfxFontEntry*
|
||||
gfxFT2FontList::LookupLocalFont(const nsAString& aFontName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle)
|
||||
{
|
||||
// walk over list of names
|
||||
@ -1547,7 +1547,7 @@ gfxFT2FontList::GetDefaultFontForPlatform(const gfxFontStyle* aStyle)
|
||||
gfxFontEntry*
|
||||
gfxFT2FontList::MakePlatformFont(const nsAString& aFontName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength)
|
||||
|
@ -44,7 +44,7 @@ public:
|
||||
static FT2FontEntry*
|
||||
CreateFontEntry(const nsAString& aFontName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength);
|
||||
@ -123,12 +123,12 @@ public:
|
||||
|
||||
virtual gfxFontEntry* LookupLocalFont(const nsAString& aFontName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle) override;
|
||||
|
||||
virtual gfxFontEntry* MakePlatformFont(const nsAString& aFontName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength) override;
|
||||
|
@ -312,7 +312,7 @@ CreateFaceForPattern(FcPattern* aPattern)
|
||||
|
||||
gfxFontconfigFontEntry::gfxFontconfigFontEntry(const nsAString& aFaceName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle,
|
||||
const uint8_t *aData,
|
||||
uint32_t aLength,
|
||||
@ -335,7 +335,7 @@ gfxFontconfigFontEntry::gfxFontconfigFontEntry(const nsAString& aFaceName,
|
||||
gfxFontconfigFontEntry::gfxFontconfigFontEntry(const nsAString& aFaceName,
|
||||
FcPattern* aFontPattern,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle)
|
||||
: gfxFontEntry(aFaceName), mFontPattern(aFontPattern),
|
||||
mFTFace(nullptr), mFTFaceInitialized(false),
|
||||
@ -1858,7 +1858,7 @@ gfxFcPlatformFontList::GetDefaultFontForPlatform(const gfxFontStyle* aStyle)
|
||||
gfxFontEntry*
|
||||
gfxFcPlatformFontList::LookupLocalFont(const nsAString& aFontName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle)
|
||||
{
|
||||
nsAutoString keyName(aFontName);
|
||||
@ -1877,7 +1877,7 @@ gfxFcPlatformFontList::LookupLocalFont(const nsAString& aFontName,
|
||||
gfxFontEntry*
|
||||
gfxFcPlatformFontList::MakePlatformFont(const nsAString& aFontName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength)
|
||||
|
@ -95,7 +95,7 @@ public:
|
||||
// of the font data and the FT_Face
|
||||
explicit gfxFontconfigFontEntry(const nsAString& aFaceName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle,
|
||||
const uint8_t *aData,
|
||||
uint32_t aLength,
|
||||
@ -105,7 +105,7 @@ public:
|
||||
explicit gfxFontconfigFontEntry(const nsAString& aFaceName,
|
||||
FcPattern* aFontPattern,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle);
|
||||
|
||||
gfxFontEntry* Clone() const override;
|
||||
@ -290,12 +290,12 @@ public:
|
||||
gfxFontEntry*
|
||||
LookupLocalFont(const nsAString& aFontName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch, uint8_t aStyle) override;
|
||||
uint16_t aStretch, uint8_t aStyle) override;
|
||||
|
||||
gfxFontEntry*
|
||||
MakePlatformFont(const nsAString& aFontName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength) override;
|
||||
|
@ -4125,7 +4125,7 @@ gfxFontStyle::gfxFontStyle() :
|
||||
|
||||
gfxFontStyle::gfxFontStyle(uint8_t aStyle,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
gfxFloat aSize,
|
||||
nsAtom *aLanguage, bool aExplicitLanguage,
|
||||
float aSizeAdjust, bool aSystemFont,
|
||||
|
@ -79,7 +79,7 @@ struct gfxFontStyle {
|
||||
typedef mozilla::FontWeight FontWeight;
|
||||
|
||||
gfxFontStyle();
|
||||
gfxFontStyle(uint8_t aStyle, FontWeight aWeight, int16_t aStretch,
|
||||
gfxFontStyle(uint8_t aStyle, FontWeight aWeight, uint16_t aStretch,
|
||||
gfxFloat aSize, nsAtom *aLanguage, bool aExplicitLanguage,
|
||||
float aSizeAdjust, bool aSystemFont,
|
||||
bool aPrinterFont,
|
||||
@ -142,9 +142,8 @@ struct gfxFontStyle {
|
||||
// The weight of the font: 100, 200, ... 900.
|
||||
FontWeight weight;
|
||||
|
||||
// The stretch of the font (the sum of various NS_FONT_STRETCH_*
|
||||
// constants; see gfxFontConstants.h).
|
||||
int8_t stretch;
|
||||
// The stretch of the font (NS_FONT_STRETCH_*, see gfxFontConstants.h).
|
||||
uint8_t stretch;
|
||||
|
||||
// The style of font (normal, italic, oblique)
|
||||
uint8_t style;
|
||||
|
@ -21,15 +21,15 @@
|
||||
#define NS_FONT_WEIGHT_BOLD 700
|
||||
#define NS_FONT_WEIGHT_THIN 100
|
||||
|
||||
#define NS_FONT_STRETCH_ULTRA_CONDENSED (-4)
|
||||
#define NS_FONT_STRETCH_EXTRA_CONDENSED (-3)
|
||||
#define NS_FONT_STRETCH_CONDENSED (-2)
|
||||
#define NS_FONT_STRETCH_SEMI_CONDENSED (-1)
|
||||
#define NS_FONT_STRETCH_NORMAL 0
|
||||
#define NS_FONT_STRETCH_SEMI_EXPANDED 1
|
||||
#define NS_FONT_STRETCH_EXPANDED 2
|
||||
#define NS_FONT_STRETCH_EXTRA_EXPANDED 3
|
||||
#define NS_FONT_STRETCH_ULTRA_EXPANDED 4
|
||||
#define NS_FONT_STRETCH_ULTRA_CONDENSED 50
|
||||
#define NS_FONT_STRETCH_EXTRA_CONDENSED 62
|
||||
#define NS_FONT_STRETCH_CONDENSED 75
|
||||
#define NS_FONT_STRETCH_SEMI_CONDENSED 87
|
||||
#define NS_FONT_STRETCH_NORMAL 100
|
||||
#define NS_FONT_STRETCH_SEMI_EXPANDED 112
|
||||
#define NS_FONT_STRETCH_EXPANDED 125
|
||||
#define NS_FONT_STRETCH_EXTRA_EXPANDED 150
|
||||
#define NS_FONT_STRETCH_ULTRA_EXPANDED 200
|
||||
|
||||
#define NS_FONT_SMOOTHING_AUTO 0
|
||||
#define NS_FONT_SMOOTHING_GRAYSCALE 1
|
||||
|
@ -1190,18 +1190,18 @@ StyleDistance(uint32_t aFontStyle, uint32_t aTargetStyle)
|
||||
return 1; // neither is normal; must be italic vs oblique ==> 1
|
||||
}
|
||||
|
||||
#define REVERSE_STRETCH_DISTANCE 5
|
||||
#define REVERSE_STRETCH_DISTANCE 200
|
||||
|
||||
// stretch distance ==> [0,13]
|
||||
// stretch distance ==> [0,350]
|
||||
static inline uint32_t
|
||||
StretchDistance(int16_t aFontStretch, int16_t aTargetStretch)
|
||||
StretchDistance(int32_t aFontStretch, int32_t aTargetStretch)
|
||||
{
|
||||
int32_t distance = 0;
|
||||
if (aTargetStretch != aFontStretch) {
|
||||
// stretch values are in the range -4 .. +4
|
||||
// if aTargetStretch is positive, we prefer more-positive values;
|
||||
// if zero or negative, prefer more-negative
|
||||
if (aTargetStretch > 0) {
|
||||
// stretch values are in the range 50 .. 200
|
||||
// if aTargetStretch is >100, we prefer larger values;
|
||||
// if <=100, prefer smaller
|
||||
if (aTargetStretch > 100) {
|
||||
distance = (aFontStretch - aTargetStretch);
|
||||
} else {
|
||||
distance = (aTargetStretch - aFontStretch);
|
||||
@ -1209,7 +1209,7 @@ StretchDistance(int16_t aFontStretch, int16_t aTargetStretch)
|
||||
// if the computed "distance" here is negative, it means that
|
||||
// aFontEntry lies in the "non-preferred" direction from aTargetStretch,
|
||||
// so we treat that as larger than any preferred-direction distance
|
||||
// (max possible is 4) by adding an extra 5 to the absolute value
|
||||
// (max possible is 150) by adding an extra 200 to the absolute value
|
||||
if (distance < 0) {
|
||||
distance = -distance + REVERSE_STRETCH_DISTANCE;
|
||||
}
|
||||
@ -1435,7 +1435,7 @@ gfxFontFamily::CheckForSimpleFamily()
|
||||
return;
|
||||
}
|
||||
|
||||
int16_t firstStretch = mAvailableFonts[0]->Stretch();
|
||||
uint16_t firstStretch = mAvailableFonts[0]->Stretch();
|
||||
|
||||
gfxFontEntry *faces[4] = { 0 };
|
||||
for (uint8_t i = 0; i < count; ++i) {
|
||||
|
@ -142,7 +142,7 @@ public:
|
||||
virtual nsString RealFaceName();
|
||||
|
||||
FontWeight Weight() const { return mWeight; }
|
||||
int16_t Stretch() const { return mStretch; }
|
||||
uint16_t Stretch() const { return mStretch; }
|
||||
|
||||
bool IsUserFont() const { return mIsDataUserFont || mIsLocalUserFont; }
|
||||
bool IsLocalUserFont() const { return mIsLocalUserFont; }
|
||||
@ -405,7 +405,7 @@ public:
|
||||
uint32_t mNonDefaultSubSpaceFeatures[(int(Script::NUM_SCRIPT_CODES) + 31) / 32];
|
||||
|
||||
FontWeight mWeight;
|
||||
int16_t mStretch;
|
||||
uint16_t mStretch;
|
||||
|
||||
RefPtr<gfxCharacterMap> mCharacterMap;
|
||||
uint32_t mUVSOffset;
|
||||
|
@ -117,7 +117,7 @@ GDIFontEntry::GDIFontEntry(const nsAString& aFaceName,
|
||||
gfxWindowsFontType aFontType,
|
||||
uint8_t aStyle,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
gfxUserFontData *aUserFontData)
|
||||
: gfxFontEntry(aFaceName),
|
||||
mFontType(aFontType),
|
||||
@ -396,7 +396,7 @@ GDIFontEntry::CreateFontEntry(const nsAString& aName,
|
||||
gfxWindowsFontType aFontType,
|
||||
uint8_t aStyle,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
gfxUserFontData* aUserFontData)
|
||||
{
|
||||
// jtdfix - need to set charset, unicode ranges, pitch/family
|
||||
@ -711,7 +711,7 @@ gfxGDIFontList::EnumFontFamExProc(ENUMLOGFONTEXW *lpelfe,
|
||||
gfxFontEntry*
|
||||
gfxGDIFontList::LookupLocalFont(const nsAString& aFontName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle)
|
||||
{
|
||||
gfxFontEntry *lookup;
|
||||
@ -803,7 +803,7 @@ FixupSymbolEncodedFont(uint8_t* aFontData, uint32_t aLength)
|
||||
gfxFontEntry*
|
||||
gfxGDIFontList::MakePlatformFont(const nsAString& aFontName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength)
|
||||
|
@ -170,13 +170,13 @@ public:
|
||||
gfxWindowsFontType aFontType,
|
||||
uint8_t aStyle,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
gfxUserFontData* aUserFontData);
|
||||
|
||||
// create a font entry for a font referenced by its fullname
|
||||
static GDIFontEntry* LoadLocalFont(const nsAString& aFontName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle);
|
||||
|
||||
gfxWindowsFontType mFontType;
|
||||
@ -188,7 +188,7 @@ protected:
|
||||
friend class gfxGDIFont;
|
||||
|
||||
GDIFontEntry(const nsAString& aFaceName, gfxWindowsFontType aFontType,
|
||||
uint8_t aStyle, FontWeight aWeight, int16_t aStretch,
|
||||
uint8_t aStyle, FontWeight aWeight, uint16_t aStretch,
|
||||
gfxUserFontData *aUserFontData);
|
||||
|
||||
void InitLogFont(const nsAString& aName, gfxWindowsFontType aFontType);
|
||||
@ -339,12 +339,12 @@ public:
|
||||
|
||||
virtual gfxFontEntry* LookupLocalFont(const nsAString& aFontName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle);
|
||||
|
||||
virtual gfxFontEntry* MakePlatformFont(const nsAString& aFontName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength);
|
||||
|
@ -132,12 +132,12 @@ public:
|
||||
|
||||
gfxFontEntry* LookupLocalFont(const nsAString& aFontName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle) override;
|
||||
|
||||
gfxFontEntry* MakePlatformFont(const nsAString& aFontName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength) override;
|
||||
|
@ -1534,7 +1534,7 @@ gfxMacPlatformFontList::AppleWeightToCSSWeight(int32_t aAppleWeight)
|
||||
gfxFontEntry*
|
||||
gfxMacPlatformFontList::LookupLocalFont(const nsAString& aFontName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle)
|
||||
{
|
||||
nsAutoreleasePool localPool;
|
||||
@ -1567,7 +1567,7 @@ static void ReleaseData(void *info, const void *data, size_t size)
|
||||
gfxFontEntry*
|
||||
gfxMacPlatformFontList::MakePlatformFont(const nsAString& aFontName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength)
|
||||
|
@ -1759,7 +1759,7 @@ gfxPlatform::IsFontFormatSupported(uint32_t aFormatFlags)
|
||||
gfxFontEntry*
|
||||
gfxPlatform::LookupLocalFont(const nsAString& aFontName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle)
|
||||
{
|
||||
return gfxPlatformFontList::PlatformFontList()->LookupLocalFont(aFontName,
|
||||
@ -1771,7 +1771,7 @@ gfxPlatform::LookupLocalFont(const nsAString& aFontName,
|
||||
gfxFontEntry*
|
||||
gfxPlatform::MakePlatformFont(const nsAString& aFontName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength)
|
||||
|
@ -394,7 +394,7 @@ public:
|
||||
*/
|
||||
virtual gfxFontEntry* LookupLocalFont(const nsAString& aFontName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle);
|
||||
|
||||
/**
|
||||
@ -407,7 +407,7 @@ public:
|
||||
*/
|
||||
virtual gfxFontEntry* MakePlatformFont(const nsAString& aFontName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength);
|
||||
|
@ -189,14 +189,14 @@ public:
|
||||
// look up a font by name on the host platform
|
||||
virtual gfxFontEntry* LookupLocalFont(const nsAString& aFontName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle) = 0;
|
||||
|
||||
// create a new platform font from downloaded data (@font-face)
|
||||
// this method is responsible to ensure aFontData is free()'d
|
||||
virtual gfxFontEntry* MakePlatformFont(const nsAString& aFontName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength) = 0;
|
||||
|
@ -276,7 +276,7 @@ gfxPlatformGtk::CreateFontGroup(const FontFamilyList& aFontFamilyList,
|
||||
gfxFontEntry*
|
||||
gfxPlatformGtk::LookupLocalFont(const nsAString& aFontName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle)
|
||||
{
|
||||
gfxPlatformFontList* pfl = gfxPlatformFontList::PlatformFontList();
|
||||
@ -287,7 +287,7 @@ gfxPlatformGtk::LookupLocalFont(const nsAString& aFontName,
|
||||
gfxFontEntry*
|
||||
gfxPlatformGtk::MakePlatformFont(const nsAString& aFontName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength)
|
||||
|
@ -67,7 +67,7 @@ public:
|
||||
*/
|
||||
virtual gfxFontEntry* LookupLocalFont(const nsAString& aFontName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle) override;
|
||||
|
||||
/**
|
||||
@ -76,7 +76,7 @@ public:
|
||||
*/
|
||||
virtual gfxFontEntry* MakePlatformFont(const nsAString& aFontName,
|
||||
FontWeight aWeight,
|
||||
int16_t aStretch,
|
||||
uint16_t aStretch,
|
||||
uint8_t aStyle,
|
||||
const uint8_t* aFontData,
|
||||
uint32_t aLength) override;
|
||||
|
@ -106,7 +106,7 @@ private:
|
||||
gfxUserFontEntry::gfxUserFontEntry(gfxUserFontSet* aFontSet,
|
||||
const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
|
||||
FontWeight aWeight,
|
||||
int32_t aStretch,
|
||||
uint32_t aStretch,
|
||||
uint8_t aStyle,
|
||||
const nsTArray<gfxFontFeature>& aFeatureSettings,
|
||||
const nsTArray<gfxFontVariation>& aVariationSettings,
|
||||
@ -146,7 +146,7 @@ gfxUserFontEntry::~gfxUserFontEntry()
|
||||
bool
|
||||
gfxUserFontEntry::Matches(const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
|
||||
FontWeight aWeight,
|
||||
int32_t aStretch,
|
||||
uint32_t aStretch,
|
||||
uint8_t aStyle,
|
||||
const nsTArray<gfxFontFeature>& aFeatureSettings,
|
||||
const nsTArray<gfxFontVariation>& aVariationSettings,
|
||||
@ -937,7 +937,7 @@ gfxUserFontSet::FindOrCreateUserFontEntry(
|
||||
const nsAString& aFamilyName,
|
||||
const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
|
||||
FontWeight aWeight,
|
||||
int32_t aStretch,
|
||||
uint32_t aStretch,
|
||||
uint8_t aStyle,
|
||||
const nsTArray<gfxFontFeature>& aFeatureSettings,
|
||||
const nsTArray<gfxFontVariation>& aVariationSettings,
|
||||
@ -977,7 +977,7 @@ already_AddRefed<gfxUserFontEntry>
|
||||
gfxUserFontSet::CreateUserFontEntry(
|
||||
const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
|
||||
FontWeight aWeight,
|
||||
int32_t aStretch,
|
||||
uint32_t aStretch,
|
||||
uint8_t aStyle,
|
||||
const nsTArray<gfxFontFeature>& aFeatureSettings,
|
||||
const nsTArray<gfxFontVariation>& aVariationSettings,
|
||||
@ -998,7 +998,7 @@ gfxUserFontSet::FindExistingUserFontEntry(
|
||||
gfxUserFontFamily* aFamily,
|
||||
const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
|
||||
FontWeight aWeight,
|
||||
int32_t aStretch,
|
||||
uint32_t aStretch,
|
||||
uint8_t aStyle,
|
||||
const nsTArray<gfxFontFeature>& aFeatureSettings,
|
||||
const nsTArray<gfxFontVariation>& aVariationSettings,
|
||||
|
@ -232,7 +232,7 @@ public:
|
||||
virtual already_AddRefed<gfxUserFontEntry> CreateUserFontEntry(
|
||||
const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
|
||||
FontWeight aWeight,
|
||||
int32_t aStretch,
|
||||
uint32_t aStretch,
|
||||
uint8_t aStyle,
|
||||
const nsTArray<gfxFontFeature>& aFeatureSettings,
|
||||
const nsTArray<gfxFontVariation>& aVariationSettings,
|
||||
@ -246,7 +246,7 @@ public:
|
||||
const nsAString& aFamilyName,
|
||||
const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
|
||||
FontWeight aWeight,
|
||||
int32_t aStretch,
|
||||
uint32_t aStretch,
|
||||
uint8_t aStyle,
|
||||
const nsTArray<gfxFontFeature>& aFeatureSettings,
|
||||
const nsTArray<gfxFontVariation>& aVariationSettings,
|
||||
@ -500,7 +500,7 @@ protected:
|
||||
gfxUserFontFamily* aFamily,
|
||||
const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
|
||||
FontWeight aWeight,
|
||||
int32_t aStretch,
|
||||
uint32_t aStretch,
|
||||
uint8_t aStyle,
|
||||
const nsTArray<gfxFontFeature>& aFeatureSettings,
|
||||
const nsTArray<gfxFontVariation>& aVariationSettings,
|
||||
@ -552,7 +552,7 @@ public:
|
||||
gfxUserFontEntry(gfxUserFontSet* aFontSet,
|
||||
const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
|
||||
FontWeight aWeight,
|
||||
int32_t aStretch,
|
||||
uint32_t aStretch,
|
||||
uint8_t aStyle,
|
||||
const nsTArray<gfxFontFeature>& aFeatureSettings,
|
||||
const nsTArray<gfxFontVariation>& aVariationSettings,
|
||||
@ -565,7 +565,7 @@ public:
|
||||
// Return whether the entry matches the given list of attributes
|
||||
bool Matches(const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
|
||||
FontWeight aWeight,
|
||||
int32_t aStretch,
|
||||
uint32_t aStretch,
|
||||
uint8_t aStyle,
|
||||
const nsTArray<gfxFontFeature>& aFeatureSettings,
|
||||
const nsTArray<gfxFontVariation>& aVariationSettings,
|
||||
|
@ -49,7 +49,7 @@ public:
|
||||
Entry(gfxUserFontSet* aFontSet,
|
||||
const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
|
||||
FontWeight aWeight,
|
||||
int32_t aStretch,
|
||||
uint32_t aStretch,
|
||||
uint8_t aStyle,
|
||||
const nsTArray<gfxFontFeature>& aFeatureSettings,
|
||||
const nsTArray<gfxFontVariation>& aVariationSettings,
|
||||
|
@ -207,7 +207,7 @@ FontFaceSet::ParseFontShorthandForMatching(
|
||||
const nsAString& aFont,
|
||||
RefPtr<SharedFontList>& aFamilyList,
|
||||
FontWeight& aWeight,
|
||||
int32_t& aStretch,
|
||||
uint32_t& aStretch,
|
||||
uint8_t& aStyle,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
@ -254,7 +254,7 @@ FontFaceSet::FindMatchingFontFaces(const nsAString& aFont,
|
||||
{
|
||||
RefPtr<SharedFontList> familyList;
|
||||
FontWeight weight;
|
||||
int32_t stretch;
|
||||
uint32_t stretch;
|
||||
uint8_t italicStyle;
|
||||
ParseFontShorthandForMatching(aFont, familyList, weight, stretch, italicStyle,
|
||||
aRv);
|
||||
@ -979,7 +979,7 @@ FontFaceSet::FindOrCreateUserFontEntryFromFontFace(const nsAString& aFamilyName,
|
||||
nsCSSUnit unit;
|
||||
|
||||
FontWeight weight = FontWeight::Normal();
|
||||
int32_t stretch = NS_STYLE_FONT_STRETCH_NORMAL;
|
||||
uint32_t stretch = NS_STYLE_FONT_STRETCH_NORMAL;
|
||||
uint8_t italicStyle = NS_STYLE_FONT_STYLE_NORMAL;
|
||||
uint32_t languageOverride = NO_FONT_LANGUAGE_OVERRIDE;
|
||||
uint8_t fontDisplay = NS_FONT_DISPLAY_AUTO;
|
||||
@ -1930,7 +1930,7 @@ FontFaceSet::UserFontSet::DoRebuildUserFontSet()
|
||||
FontFaceSet::UserFontSet::CreateUserFontEntry(
|
||||
const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
|
||||
FontWeight aWeight,
|
||||
int32_t aStretch,
|
||||
uint32_t aStretch,
|
||||
uint8_t aStyle,
|
||||
const nsTArray<gfxFontFeature>& aFeatureSettings,
|
||||
const nsTArray<gfxFontVariation>& aVariationSettings,
|
||||
|
@ -99,7 +99,7 @@ public:
|
||||
already_AddRefed<gfxUserFontEntry> CreateUserFontEntry(
|
||||
const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
|
||||
FontWeight aWeight,
|
||||
int32_t aStretch,
|
||||
uint32_t aStretch,
|
||||
uint8_t aStyle,
|
||||
const nsTArray<gfxFontFeature>& aFeatureSettings,
|
||||
const nsTArray<gfxFontVariation>& aVariationSettings,
|
||||
@ -314,7 +314,7 @@ private:
|
||||
const nsAString& aFont,
|
||||
RefPtr<SharedFontList>& aFamilyList,
|
||||
FontWeight& aWeight,
|
||||
int32_t& aStretch,
|
||||
uint32_t& aStretch,
|
||||
uint8_t& aStyle,
|
||||
ErrorResult& aRv);
|
||||
void FindMatchingFontFaces(const nsAString& aFont,
|
||||
|
Loading…
Reference in New Issue
Block a user