@@ -3056,6 +3056,40 @@ class ParagraphView48 : public ParagraphView_Base {
30563056 using INHERITED = Sample;
30573057};
30583058
3059+ class ParagraphView49 : public ParagraphView_Base {
3060+ protected:
3061+ SkString name () override { return SkString (" Paragraph49" ); }
3062+
3063+ void onDrawContent (SkCanvas* canvas) override {
3064+ canvas->clear (SK_ColorGRAY);
3065+ auto fontCollection = getFontCollection ();
3066+ fontCollection->disableFontFallback ();
3067+ const char * text = " AAAAAAAAA\n " ;
3068+
3069+ ParagraphStyle paragraph_style;
3070+ TextStyle text_style;
3071+ text_style.setColor (SK_ColorBLACK);
3072+ text_style.setFontFamilies ({SkString (" Roboto" ), SkString (" Noto Serif CJK JP" )});
3073+ text_style.setFontSize (16 );
3074+ ParagraphBuilderImpl builder (paragraph_style, fontCollection);
3075+ builder.pushStyle (text_style);
3076+ builder.addText (text);
3077+ PlaceholderStyle placeholder_style;
3078+ placeholder_style.fHeight = 42 ;
3079+ placeholder_style.fWidth = 45 ;
3080+ placeholder_style.fBaselineOffset = 42 ;
3081+ placeholder_style.fBaseline = TextBaseline::kAlphabetic ;
3082+ placeholder_style.fAlignment = PlaceholderAlignment::kBottom ;
3083+ builder.addPlaceholder (placeholder_style);
3084+ auto paragraph = builder.Build ();
3085+ paragraph->layout (360 );
3086+ paragraph->paint (canvas, 0 , 0 );
3087+ }
3088+
3089+ private:
3090+ using INHERITED = Sample;
3091+ };
3092+
30593093} // namespace
30603094
30613095// ////////////////////////////////////////////////////////////////////////////
@@ -3105,3 +3139,4 @@ DEF_SAMPLE(return new ParagraphView45();)
31053139DEF_SAMPLE (return new ParagraphView46();)
31063140DEF_SAMPLE (return new ParagraphView47();)
31073141DEF_SAMPLE (return new ParagraphView48();)
3142+ DEF_SAMPLE (return new ParagraphView49();)
0 commit comments