|
|
|
|
| 958 |
// Always updates the char if a better match is found. |
958 |
// Always updates the char if a better match is found. |
| 959 |
bool |
959 |
bool |
| 960 |
nsMathMLChar::StretchEnumContext::TryVariants(nsGlyphTable* aGlyphTable, |
960 |
nsMathMLChar::StretchEnumContext::TryVariants(nsGlyphTable* aGlyphTable, |
| 961 |
const nsAString& aFamily) |
961 |
const nsAString& aFamily) |
| 962 |
{ |
962 |
{ |
| 963 |
// Use our stretchy style context now that stretching is in progress |
963 |
// Use our stretchy style context now that stretching is in progress |
| 964 |
nsStyleContext *sc = mChar->mStyleContext; |
964 |
nsStyleContext *sc = mChar->mStyleContext; |
| 965 |
nsFont font = sc->StyleFont()->mFont; |
965 |
nsFont font = sc->StyleFont()->mFont; |
| 966 |
// Ensure SetFontFamily will set the font |
|
|
| 967 |
font.name.Truncate(); |
| 968 |
|
966 |
|
| 969 |
bool isVertical = (mDirection == NS_STRETCH_DIRECTION_VERTICAL); |
967 |
bool isVertical = (mDirection == NS_STRETCH_DIRECTION_VERTICAL); |
| 970 |
bool largeop = (NS_STRETCH_LARGEOP & mStretchHint) != 0; |
968 |
bool largeop = (NS_STRETCH_LARGEOP & mStretchHint) != 0; |
| 971 |
bool largeopOnly = |
969 |
bool largeopOnly = |
| 972 |
largeop && (NS_STRETCH_VARIABLE_MASK & mStretchHint) == 0; |
970 |
largeop && (NS_STRETCH_VARIABLE_MASK & mStretchHint) == 0; |
| 973 |
bool maxWidth = (NS_STRETCH_MAXWIDTH & mStretchHint) != 0; |
971 |
bool maxWidth = (NS_STRETCH_MAXWIDTH & mStretchHint) != 0; |
| 974 |
|
972 |
|
| 975 |
nscoord bestSize = |
973 |
nscoord bestSize = |
|
Lines 1059-1076
nsMathMLChar::StretchEnumContext::TryPar
|
Link Here
|
|---|
|
| 1059 |
{ |
1057 |
{ |
| 1060 |
if (!aGlyphTable->HasPartsOf(mChar->mData[0])) |
1058 |
if (!aGlyphTable->HasPartsOf(mChar->mData[0])) |
| 1061 |
return false; // to next table |
1059 |
return false; // to next table |
| 1062 |
|
1060 |
|
| 1063 |
// See if the parts of this table fit in the desired space ////////////////// |
1061 |
// See if the parts of this table fit in the desired space ////////////////// |
| 1064 |
|
1062 |
|
| 1065 |
// Use our stretchy style context now that stretching is in progress |
1063 |
// Use our stretchy style context now that stretching is in progress |
| 1066 |
nsFont font = mChar->mStyleContext->StyleFont()->mFont; |
1064 |
nsFont font = mChar->mStyleContext->StyleFont()->mFont; |
| 1067 |
// Ensure SetFontFamily will set the font |
|
|
| 1068 |
font.name.Truncate(); |
| 1069 |
|
1065 |
|
| 1070 |
// Compute the bounding metrics of all partial glyphs |
1066 |
// Compute the bounding metrics of all partial glyphs |
| 1071 |
nsAutoPtr<gfxTextRun> textRun[4]; |
1067 |
nsAutoPtr<gfxTextRun> textRun[4]; |
| 1072 |
nsGlyphCode chdata[4]; |
1068 |
nsGlyphCode chdata[4]; |
| 1073 |
nsBoundingMetrics bmdata[4]; |
1069 |
nsBoundingMetrics bmdata[4]; |
| 1074 |
nscoord sizedata[4]; |
1070 |
nscoord sizedata[4]; |
| 1075 |
|
1071 |
|
| 1076 |
bool isVertical = (mDirection == NS_STRETCH_DIRECTION_VERTICAL); |
1072 |
bool isVertical = (mDirection == NS_STRETCH_DIRECTION_VERTICAL); |