Backed out changeset 33571130ef67 (bug 1431305) for failing in /text-orientation-mixed-vlr-100-ref.html on a CLOSED TREE

This commit is contained in:
shindli 2018-01-19 17:56:20 +02:00
Родитель db6873e9f6
Коммит 6399f1f1af
6 изменённых файлов: 7 добавлений и 65 удалений

Просмотреть файл

@ -1521,40 +1521,6 @@ gfxFont::SupportsSubSuperscript(uint32_t aSubSuperscript,
return origSize == intersectionSize;
}
bool
gfxFont::FeatureWillHandleChar(Script aRunScript, uint32_t aFeature,
uint32_t aUnicode)
{
if (!SupportsFeature(aRunScript, aFeature)) {
return false;
}
// xxx - for graphite, don't really know how to sniff lookups so bail
if (mGraphiteShaper && gfxPlatform::GetPlatform()->UseGraphiteShaping()) {
return true;
}
if (!mHarfBuzzShaper) {
mHarfBuzzShaper = MakeUnique<gfxHarfBuzzShaper>(this);
}
gfxHarfBuzzShaper* shaper =
static_cast<gfxHarfBuzzShaper*>(mHarfBuzzShaper.get());
if (!shaper->Initialize()) {
return false;
}
// get the hbset containing input glyphs for the feature
const hb_set_t *inputGlyphs =
mFontEntry->InputsForOpenTypeFeature(aRunScript, aFeature);
if (aUnicode == 0xa0) {
aUnicode = ' ';
}
hb_codepoint_t gid = shaper->GetNominalGlyph(aUnicode);
return hb_set_has(inputGlyphs, gid);
}
bool
gfxFont::HasFeatureSet(uint32_t aFeature, bool& aFeatureOn)
{

Просмотреть файл

@ -1593,10 +1593,6 @@ public:
uint32_t aLength,
Script aRunScript);
// whether the specified feature will apply to the given character
bool FeatureWillHandleChar(Script aRunScript, uint32_t aFeature,
uint32_t aUnicode);
// Subclasses may choose to look up glyph ids for characters.
// If they do not override this, gfxHarfBuzzShaper will fetch the cmap
// table and use that.

Просмотреть файл

@ -848,8 +848,7 @@ gfxFontEntry::InputsForOpenTypeFeature(Script aScript, uint32_t aFeatureTag)
}
NS_ASSERTION(aFeatureTag == HB_TAG('s','u','p','s') ||
aFeatureTag == HB_TAG('s','u','b','s') ||
aFeatureTag == HB_TAG('v','e','r','t'),
aFeatureTag == HB_TAG('s','u','b','s'),
"use of unknown feature tag");
uint32_t scriptFeature = SCRIPT_FEATURE(aScript, aFeatureTag);

Просмотреть файл

@ -209,8 +209,8 @@ VertFormsGlyphCompare(const void* aKey, const void* aElem)
// Return a vertical presentation-form codepoint corresponding to the
// given Unicode value, or 0 if no such form is available.
hb_codepoint_t
gfxHarfBuzzShaper::GetVerticalPresentationForm(hb_codepoint_t aUnicode)
static hb_codepoint_t
GetVerticalPresentationForm(hb_codepoint_t unicode)
{
static const uint16_t sVerticalForms[][2] = {
{ 0x2013, 0xfe32 }, // EN DASH
@ -248,7 +248,7 @@ gfxHarfBuzzShaper::GetVerticalPresentationForm(hb_codepoint_t aUnicode)
{ 0xff5d, 0xfe38 } // FULLWIDTH RIGHT CURLY BRACKET
};
const uint16_t* charPair =
static_cast<const uint16_t*>(bsearch(&aUnicode,
static_cast<const uint16_t*>(bsearch(&unicode,
sVerticalForms,
ArrayLength(sVerticalForms),
sizeof(sVerticalForms[0]),
@ -266,8 +266,7 @@ HBGetNominalGlyph(hb_font_t *font, void *font_data,
static_cast<const gfxHarfBuzzShaper::FontCallbackData*>(font_data);
if (fcd->mShaper->UseVerticalPresentationForms()) {
hb_codepoint_t verticalForm =
gfxHarfBuzzShaper::GetVerticalPresentationForm(unicode);
hb_codepoint_t verticalForm = GetVerticalPresentationForm(unicode);
if (verticalForm) {
*glyph = fcd->mShaper->GetNominalGlyph(verticalForm);
if (*glyph != 0) {
@ -291,8 +290,7 @@ HBGetVariationGlyph(hb_font_t *font, void *font_data,
static_cast<const gfxHarfBuzzShaper::FontCallbackData*>(font_data);
if (fcd->mShaper->UseVerticalPresentationForms()) {
hb_codepoint_t verticalForm =
gfxHarfBuzzShaper::GetVerticalPresentationForm(unicode);
hb_codepoint_t verticalForm = GetVerticalPresentationForm(unicode);
if (verticalForm) {
*glyph = fcd->mShaper->GetVariationGlyph(verticalForm,
variation_selector);

Просмотреть файл

@ -97,9 +97,6 @@ public:
return hbScript;
}
static hb_codepoint_t
GetVerticalPresentationForm(hb_codepoint_t aUnicode);
protected:
nsresult SetGlyphsFromRun(gfxShapedText *aShapedText,
uint32_t aOffset,

Просмотреть файл

@ -3180,24 +3180,10 @@ void gfxFontGroup::ComputeRanges(nsTArray<gfxTextRange>& aRanges,
// on a per-character basis using the UTR50 orientation property.
switch (GetVerticalOrientation(ch)) {
case VERTICAL_ORIENTATION_U:
case VERTICAL_ORIENTATION_Tr:
case VERTICAL_ORIENTATION_Tu:
orient = ShapedTextFlags::TEXT_ORIENT_VERTICAL_UPRIGHT;
break;
case VERTICAL_ORIENTATION_Tr: {
// We check for a vertical presentation form first as that's
// likely to be cheaper than inspecting lookups to see if the
// 'vert' feature is going to handle this character, and if the
// presentation form is available then it will be used as
// fallback if needed, so it's OK if the feature is missing.
uint32_t v = gfxHarfBuzzShaper::GetVerticalPresentationForm(ch);
orient = ((v && font->HasCharacter(v)) ||
font->FeatureWillHandleChar(aRunScript,
HB_TAG('v','e','r','t'),
ch))
? ShapedTextFlags::TEXT_ORIENT_VERTICAL_UPRIGHT
: ShapedTextFlags::TEXT_ORIENT_VERTICAL_SIDEWAYS_RIGHT;
break;
}
case VERTICAL_ORIENTATION_R:
orient = ShapedTextFlags::TEXT_ORIENT_VERTICAL_SIDEWAYS_RIGHT;
break;