未验证 提交 728e473f 编写于 作者: G Gary Qian 提交者: GitHub

Pass LinearTextFlat to SkFont - iOS13 letter spacing (#13321)

上级 6f265978
......@@ -317,10 +317,8 @@ int Layout::findFace(const FakedFont& face, LayoutContext* ctx) {
// corresponding hb_font object.
if (ctx != NULL) {
hb_font_t* font = getHbFontLocked(face.font);
// Temporarily removed to fix advance integer rounding.
// This is likely due to very old versions of harfbuzz and ICU.
// hb_font_set_funcs(font, getHbFontFuncs(isColorBitmapFont(font)),
// &ctx->paint, 0);
hb_font_set_funcs(font, getHbFontFuncs(isColorBitmapFont(font)),
&ctx->paint, 0);
ctx->hbFonts.push_back(font);
}
return ix;
......
......@@ -52,6 +52,7 @@ static void FontSkia_SetSkiaFont(sk_sp<SkTypeface> typeface,
SkFont* skFont,
const minikin::MinikinPaint& paint) {
skFont->setTypeface(std::move(typeface));
skFont->setLinearMetrics((paint.paintFlags & minikin::LinearTextFlag) != 0);
// TODO: set more paint parameters from Minikin
skFont->setSize(paint.size);
}
......
......@@ -129,6 +129,7 @@ class ParagraphTxt : public Paragraph {
private:
friend class ParagraphBuilderTxt;
FRIEND_TEST(ParagraphTest, SimpleParagraph);
FRIEND_TEST(ParagraphTest, SimpleParagraphSmall);
FRIEND_TEST(ParagraphTest, SimpleRedParagraph);
FRIEND_TEST(ParagraphTest, RainbowParagraph);
FRIEND_TEST(ParagraphTest, DefaultStyleParagraph);
......
......@@ -62,6 +62,7 @@ class StyledRuns {
private:
FRIEND_TEST(ParagraphTest, SimpleParagraph);
FRIEND_TEST(ParagraphTest, SimpleParagraphSmall);
FRIEND_TEST(ParagraphTest, SimpleRedParagraph);
FRIEND_TEST(ParagraphTest, RainbowParagraph);
FRIEND_TEST(ParagraphTest, DefaultStyleParagraph);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册