add back deprecated methods
Don't delete the deprecated dox until the
deprecated include/core methods are also
deleted.
TBR=reed@google.com
NOTRY=true
Docs-Preview: https://skia.org/?cl=164614
Bug: skia:
Change-Id: I752188b6182ae7bd3743c9c6f48553712faf50dc
Reviewed-on: https://skia-review.googlesource.com/c/164614
Commit-Queue: Cary Clark <caryclark@google.com>
Auto-Submit: Cary Clark <caryclark@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
diff --git a/docs/SkPaint_Reference.bmh b/docs/SkPaint_Reference.bmh
index 9762899..6337a33 100644
--- a/docs/SkPaint_Reference.bmh
+++ b/docs/SkPaint_Reference.bmh
@@ -1254,6 +1254,14 @@
# ------------------------------------------------------------------------------
+#Method bool isVerticalText() const
+#Deprecated
+##
+
+#Method void setVerticalText(bool)
+#Deprecated
+##
+
#Subtopic Fake_Bold
#Line # approximate font styles ##
diff --git a/site/user/api/SkCanvas_Reference.md b/site/user/api/SkCanvas_Reference.md
index 2088c6e..1020d2e 100644
--- a/site/user/api/SkCanvas_Reference.md
+++ b/site/user/api/SkCanvas_Reference.md
@@ -443,15 +443,15 @@
### Example
-<div><fiddle-embed name="903451d6c93bf69e2833747a3e8cc8f7"><div>Passes a placeholder to a function that requires one.
+<div><fiddle-embed name="4a00e6589e862fde5be532f4b6e316ce"><div>Passes a placeholder to a function that requires one.
</div>
#### Example Output
~~~~
-paint draws text left to right
-paint draws text top to bottom
-paint draws text top to bottom
+rect stays rect is true
+rect stays rect is false
+rect stays rect is true
~~~~
</fiddle-embed></div>
@@ -5230,7 +5230,7 @@
<a href='#SkCanvas_drawText_text'>text</a> meaning depends on <a href='SkPaint_Reference#Text_Encoding'>Paint Text Encoding</a>; by default, <a href='#SkCanvas_drawText_text'>text</a> is encoded as
UTF-8.
-<a href='#SkCanvas_drawText_x'>x</a> and <a href='#SkCanvas_drawText_y'>y</a> meaning depends on <a href='SkPaint_Reference#Text_Align'>Paint Text Align</a> and <a href='SkPaint_Reference#Vertical_Text'>Paint Vertical Text</a>; by default
+<a href='#SkCanvas_drawText_x'>x</a> and <a href='#SkCanvas_drawText_y'>y</a> meaning depends on <a href='SkPaint_Reference#Text_Align'>Paint Text Align</a>; by default
<a href='#SkCanvas_drawText_text'>text</a> draws left to right, positioning the first glyph left side bearing at <a href='#SkCanvas_drawText_x'>x</a>
and its baseline at <a href='#SkCanvas_drawText_y'>y</a>. <a href='undocumented#Text'>Text</a> size is affected by <a href='#Matrix'>Matrix</a> and <a href='SkPaint_Reference#Text_Size'>Paint Text Size</a>.
@@ -5282,8 +5282,7 @@
as UTF-8. Other values of <a href='SkPaint_Reference#Text_Encoding'>Paint Text Encoding</a> are unlikely to produce the desired
results, since zero bytes may be embedded in the <a href='#SkCanvas_drawString_string'>string</a>.
-<a href='#SkCanvas_drawString_x'>x</a> and <a href='#SkCanvas_drawString_y'>y</a> meaning depends on <a href='SkPaint_Reference#Text_Align'>Paint Text Align</a> and <a href='SkPaint_Reference#Vertical_Text'>Paint Vertical Text</a>; by default
-<a href='#SkCanvas_drawString_string'>string</a> draws left to right, positioning the first glyph left side bearing at <a href='#SkCanvas_drawString_x'>x</a>
+The <a href='#SkCanvas_drawString_string'>string</a> draws left to right, positioning the first glyph left side bearing at <a href='#SkCanvas_drawString_x'>x</a>
and its baseline at <a href='#SkCanvas_drawString_y'>y</a>. <a href='undocumented#Text'>Text</a> size is affected by <a href='#Matrix'>Matrix</a> and <a href='SkPaint_Reference#Text_Size'>Paint Text Size</a>.
All elements of <a href='#SkCanvas_drawString_paint'>paint</a>: <a href='undocumented#Path_Effect'>Path Effect</a>, <a href='undocumented#Mask_Filter'>Mask Filter</a>, <a href='undocumented#Shader'>Shader</a>,
@@ -5330,8 +5329,7 @@
as UTF-8. Other values of <a href='SkPaint_Reference#Text_Encoding'>Paint Text Encoding</a> are unlikely to produce the desired
results, since zero bytes may be embedded in the <a href='#SkCanvas_drawString_2_string'>string</a>.
-<a href='#SkCanvas_drawString_2_x'>x</a> and <a href='#SkCanvas_drawString_2_y'>y</a> meaning depends on <a href='SkPaint_Reference#Text_Align'>Paint Text Align</a> and <a href='SkPaint_Reference#Vertical_Text'>Paint Vertical Text</a>; by default
-<a href='#SkCanvas_drawString_2_string'>string</a> draws left to right, positioning the first glyph left side bearing at <a href='#SkCanvas_drawString_2_x'>x</a>
+The <a href='#SkCanvas_drawString_2_string'>string</a> draws left to right, positioning the first glyph left side bearing at <a href='#SkCanvas_drawString_2_x'>x</a>
and its baseline at <a href='#SkCanvas_drawString_2_y'>y</a>. <a href='undocumented#Text'>Text</a> size is affected by <a href='#Matrix'>Matrix</a> and <a href='SkPaint_Reference#Text_Size'>Paint Text Size</a>.
All elements of <a href='#SkCanvas_drawString_2_paint'>paint</a>: <a href='undocumented#Path_Effect'>Path Effect</a>, <a href='undocumented#Mask_Filter'>Mask Filter</a>, <a href='undocumented#Shader'>Shader</a>,
@@ -5376,8 +5374,7 @@
described by <a href='#SkCanvas_drawPosText_byteLength'>byteLength</a> of <a href='#SkCanvas_drawPosText_text'>text</a>.
<a href='#SkCanvas_drawPosText_text'>text</a> meaning depends on <a href='SkPaint_Reference#Text_Encoding'>Paint Text Encoding</a>; by default, <a href='#SkCanvas_drawPosText_text'>text</a> is encoded as
-UTF-8. <a href='#SkCanvas_drawPosText_pos'>pos</a> elements meaning depends on <a href='SkPaint_Reference#Vertical_Text'>Paint Vertical Text</a>; by default
-glyph left side bearing and baseline are relative to <a href='SkPoint_Reference#Point'>Point</a> in <a href='#SkCanvas_drawPosText_pos'>pos</a> array.
+UTF-8. glyph left side bearing and baseline are relative to <a href='SkPoint_Reference#Point'>Point</a> in <a href='#SkCanvas_drawPosText_pos'>pos</a> array.
<a href='undocumented#Text'>Text</a> size is affected by <a href='#Matrix'>Matrix</a> and <a href='SkPaint_Reference#Text_Size'>Paint Text Size</a>.
All elements of <a href='#SkCanvas_drawPosText_paint'>paint</a>: <a href='undocumented#Path_Effect'>Path Effect</a>, <a href='undocumented#Mask_Filter'>Mask Filter</a>, <a href='undocumented#Shader'>Shader</a>,
@@ -5425,8 +5422,7 @@
must match the number of <a href='undocumented#Glyph'>Glyphs</a> described by <a href='#SkCanvas_drawPosTextH_byteLength'>byteLength</a> of <a href='#SkCanvas_drawPosTextH_text'>text</a>.
<a href='#SkCanvas_drawPosTextH_text'>text</a> meaning depends on <a href='SkPaint_Reference#Text_Encoding'>Paint Text Encoding</a>; by default, <a href='#SkCanvas_drawPosTextH_text'>text</a> is encoded as
-UTF-8. <a href='#SkCanvas_drawPosTextH_xpos'>xpos</a> elements meaning depends on <a href='SkPaint_Reference#Vertical_Text'>Paint Vertical Text</a>;
-by default each glyph left side bearing is positioned at an <a href='#SkCanvas_drawPosTextH_xpos'>xpos</a> element and
+UTF-8. Each glyph left side bearing is positioned at an <a href='#SkCanvas_drawPosTextH_xpos'>xpos</a> element and
its baseline is positioned at <a href='#SkCanvas_drawPosTextH_constY'>constY</a>. <a href='undocumented#Text'>Text</a> size is affected by <a href='#Matrix'>Matrix</a> and
<a href='SkPaint_Reference#Text_Size'>Paint Text Size</a>.
diff --git a/site/user/api/SkColor_Reference.md b/site/user/api/SkColor_Reference.md
index 8a79b54..32631ce 100644
--- a/site/user/api/SkColor_Reference.md
+++ b/site/user/api/SkColor_Reference.md
@@ -371,18 +371,18 @@
---
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
+constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorBLUE'>SK_ColorBLUE</a>;
+constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorMAGENTA'>SK_ColorMAGENTA</a>;
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorGREEN'>SK_ColorGREEN</a>;
-constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorLTGRAY'>SK_ColorLTGRAY</a>;
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorRED'>SK_ColorRED</a>;
-constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorGRAY'>SK_ColorGRAY</a>;
+constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorWHITE'>SK_ColorWHITE</a>;
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorYELLOW'>SK_ColorYELLOW</a>;
+constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorCYAN'>SK_ColorCYAN</a>;
+constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorLTGRAY'>SK_ColorLTGRAY</a>;
+constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorTRANSPARENT'>SK_ColorTRANSPARENT</a>;
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorBLACK'>SK_ColorBLACK</a>;
constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorDKGRAY'>SK_ColorDKGRAY</a>;
-constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorTRANSPARENT'>SK_ColorTRANSPARENT</a>;
-constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorCYAN'>SK_ColorCYAN</a>;
-constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorWHITE'>SK_ColorWHITE</a>;
-constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorMAGENTA'>SK_ColorMAGENTA</a>;
-constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorBLUE'>SK_ColorBLUE</a>;
+constexpr <a href='#SkColor'>SkColor</a> <a href='#SK_ColorGRAY'>SK_ColorGRAY</a>;
</pre>
<a href='#Color'>Color</a> names are provided as conveniences, but are not otherwise special.
diff --git a/site/user/api/SkMatrix_Reference.md b/site/user/api/SkMatrix_Reference.md
index bb0feaf..d2cc58b 100644
--- a/site/user/api/SkMatrix_Reference.md
+++ b/site/user/api/SkMatrix_Reference.md
@@ -790,15 +790,15 @@
---
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
- static constexpr int <a href='#SkMatrix_kMPersp2'>kMPersp2</a> = 8;
- static constexpr int <a href='#SkMatrix_kMPersp0'>kMPersp0</a> = 6;
- static constexpr int <a href='#SkMatrix_kMPersp1'>kMPersp1</a> = 7;
- static constexpr int <a href='#SkMatrix_kMSkewX'>kMSkewX</a> = 1;
- static constexpr int <a href='#SkMatrix_kMTransX'>kMTransX</a> = 2;
static constexpr int <a href='#SkMatrix_kMScaleX'>kMScaleX</a> = 0;
- static constexpr int <a href='#SkMatrix_kMSkewY'>kMSkewY</a> = 3;
+ static constexpr int <a href='#SkMatrix_kMSkewX'>kMSkewX</a> = 1;
+ static constexpr int <a href='#SkMatrix_kMPersp0'>kMPersp0</a> = 6;
static constexpr int <a href='#SkMatrix_kMScaleY'>kMScaleY</a> = 4;
static constexpr int <a href='#SkMatrix_kMTransY'>kMTransY</a> = 5;
+ static constexpr int <a href='#SkMatrix_kMSkewY'>kMSkewY</a> = 3;
+ static constexpr int <a href='#SkMatrix_kMPersp1'>kMPersp1</a> = 7;
+ static constexpr int <a href='#SkMatrix_kMPersp2'>kMPersp2</a> = 8;
+ static constexpr int <a href='#SkMatrix_kMTransX'>kMTransX</a> = 2;
</pre>
<a href='#Matrix'>Matrix</a> organizes its values in row order. These members correspond to
diff --git a/site/user/api/SkPaint_Reference.md b/site/user/api/SkPaint_Reference.md
index 6f17235..944606a 100644
--- a/site/user/api/SkPaint_Reference.md
+++ b/site/user/api/SkPaint_Reference.md
@@ -39,7 +39,6 @@
<a href='#SkPaint_kLCDRenderText_Flag'>kLCDRenderText_Flag</a> = 0x200,
<a href='#SkPaint_kEmbeddedBitmapText_Flag'>kEmbeddedBitmapText_Flag</a> = 0x400,
<a href='#SkPaint_kAutoHinting_Flag'>kAutoHinting_Flag</a> = 0x800,
- <a href='#SkPaint_kVerticalText_Flag'>kVerticalText_Flag</a> = 0x1000,
<a href='#SkPaint_kAllFlags'>kAllFlags</a> = 0xFFFF,
};
@@ -65,7 +64,7 @@
bool <a href='#SkPaint_isAutohinted'>isAutohinted</a>() const;
void <a href='#SkPaint_setAutohinted'>setAutohinted</a>(bool useAutohinter);
bool <a href='#SkPaint_isVerticalText'>isVerticalText</a>() const;
- void <a href='#SkPaint_setVerticalText'>setVerticalText</a>(bool verticalText);
+ void <a href='#SkPaint_setVerticalText'>setVerticalText</a>(bool);
bool <a href='#SkPaint_isFakeBoldText'>isFakeBoldText</a>() const;
void <a href='#SkPaint_setFakeBoldText'>setFakeBoldText</a>(bool fakeBoldText);
bool <a href='#SkPaint_isDevKernText'>isDevKernText</a>() const;
@@ -312,7 +311,6 @@
| <a href='#Stroke_Join'>Stroke Join</a> | <a href='#SkPaint_kMiter_Join'>kMiter Join</a> |
| <a href='#Stroke_Width'>Stroke Width</a> | 0 |
| <a href='#Subpixel_Text'>Subpixel Text</a> | false |
-| <a href='#Vertical_Text'>Vertical Text</a> | false |
The flags, text size, hinting, and miter limit may be overridden at compile time by defining
paint default values. The overrides may be included in "SkUserConfig.h" or predefined by the
@@ -800,7 +798,6 @@
<a href='#SkPaint_kLCDRenderText_Flag'>kLCDRenderText_Flag</a> = 0x200,
<a href='#SkPaint_kEmbeddedBitmapText_Flag'>kEmbeddedBitmapText_Flag</a> = 0x400,
<a href='#SkPaint_kAutoHinting_Flag'>kAutoHinting_Flag</a> = 0x800,
- <a href='#SkPaint_kVerticalText_Flag'>kVerticalText_Flag</a> = 0x1000,
<a href='#SkPaint_kAllFlags'>kAllFlags</a> = 0xFFFF,
};
</pre>
@@ -866,12 +863,6 @@
mask for setting Automatic_Hinting</td>
</tr>
<tr style='background-color: #f0f0f0; '>
- <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kVerticalText_Flag'><code>SkPaint::kVerticalText_Flag</code></a></td>
- <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0x1000</td>
- <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
-mask for setting Vertical_Text</td>
- </tr>
- <tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kAllFlags'><code>SkPaint::kAllFlags</code></a></td>
<td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0xFFFF</td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
@@ -1578,34 +1569,6 @@
<a href='#SkPaint_isAutohinted'>isAutohinted</a> <a href='#SkPaint_Hinting'>Hinting</a>
-<a name='Vertical_Text'></a>
-
----
-
-<a href='undocumented#Text'>Text</a> may be drawn by positioning each glyph, or by positioning the first glyph and
-using <a href='undocumented#Advance'>Font Advance</a> to position subsequent <a href='undocumented#Glyph'>Glyphs</a>. By default, each successive glyph
-is positioned to the right of the preceding glyph. <a href='#Vertical_Text'>Vertical Text</a> sets successive
-<a href='undocumented#Glyph'>Glyphs</a> to position below the preceding glyph.
-
-Skia can translate text character codes as a series of <a href='undocumented#Glyph'>Glyphs</a>, but does not implement
-font substitution,
-textual substitution, line layout, or contextual spacing like <a href='undocumented#Kerning'>Kerning</a> pairs. Use
-a text shaping engine like <a href='https://harfbuzz.org/'>HarfBuzz</a></a> to translate text runs
-into glyph series.
-
-<a href='#Vertical_Text'>Vertical Text</a> is clear if text is drawn left to right or set if drawn from top to bottom.
-
-<a href='#SkPaint_Flags'>Flags</a> <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> if clear draws text left to right.
-<a href='#SkPaint_Flags'>Flags</a> <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> if set draws text top to bottom.
-
-<a href='#Vertical_Text'>Vertical Text</a> is clear by default.
-<a href='#Vertical_Text'>Vertical Text</a> can be set by default by setting <a href='undocumented#SkPaintDefaults_Flags'>SkPaintDefaults Flags</a> to
-<a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> at compile time.
-
-### Example
-
-<div><fiddle-embed name="8df5800819311b71373d9abb669b49b8"></fiddle-embed></div>
-
<a name='SkPaint_isVerticalText'></a>
---
@@ -1614,59 +1577,17 @@
bool <a href='#SkPaint_isVerticalText'>isVerticalText</a>() const
</pre>
-Returns true if <a href='undocumented#Glyph'>Glyphs</a> are drawn top to bottom instead of left to right.
-
-Equivalent to <a href='#SkPaint_getFlags'>getFlags</a> masked with <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a>.
-
-### Return Value
-
-<a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> state
-
-### Example
-
-<div><fiddle-embed name="4a269b16e644d473870ffa873396f139">
-
-#### Example Output
-
-~~~~
-paint.isVerticalText() == !!(paint.getFlags() & SkPaint::kVerticalText_Flag)
-paint.isVerticalText() == !!(paint.getFlags() & SkPaint::kVerticalText_Flag)
-~~~~
-
-</fiddle-embed></div>
+Deprecated.
<a name='SkPaint_setVerticalText'></a>
---
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
-void <a href='#SkPaint_setVerticalText'>setVerticalText</a>(bool verticalText)
+void <a href='#SkPaint_setVerticalText'>setVerticalText</a>(bool)
</pre>
-Returns true if text advance positions the next glyph below the previous glyph instead of to the
-right of previous glyph.
-
-Sets <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> if vertical is true.
-Clears <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> if vertical is false.
-
-### Parameters
-
-<table> <tr> <td><a name='SkPaint_setVerticalText_verticalText'><code><strong>verticalText</strong></code></a></td>
- <td>setting for <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a></td>
- </tr>
-</table>
-
-### Example
-
-<div><fiddle-embed name="6fbd7e9e1a346cb8d7f537786009c736">
-
-#### Example Output
-
-~~~~
-paint1 == paint2
-~~~~
-
-</fiddle-embed></div>
+Deprecated.
<a name='Fake_Bold'></a>
@@ -3783,16 +3704,14 @@
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kCenter_Align'><code>SkPaint::kCenter_Align</code></a></td>
<td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
-Moves the glyph half its width if <a href='#SkPaint_Flags'>Flags</a> has <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> clear, and
-half its height if <a href='#SkPaint_Flags'>Flags</a> has <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> set.
+Moves the glyph half its width.
</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPaint_kRight_Align'><code>SkPaint::kRight_Align</code></a></td>
<td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
-Moves the glyph by its width if <a href='#SkPaint_Flags'>Flags</a> has <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> clear,
-and by its height if <a href='#SkPaint_Flags'>Flags</a> has <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> set.
+Moves the glyph by its width.
</td>
</tr>
<tr>
@@ -3809,11 +3728,6 @@
<div><fiddle-embed name="702617fd9ebc3f12e30081b5db93e8a8"><div>Each position separately moves the glyph in drawPosText.
</div></fiddle-embed></div>
-### Example
-
-<div><fiddle-embed name="f1cbbbafe6b3c52b81309cccbf96a308"><div><a href='#Vertical_Text'>Vertical Text</a> treats <a href='#SkPaint_kLeft_Align'>kLeft Align</a> as top align, and <a href='#SkPaint_kRight_Align'>kRight Align</a> as bottom align.
-</div></fiddle-embed></div>
-
<a name='SkPaint_getTextAlign'></a>
---
@@ -4801,8 +4715,7 @@
<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPaint_measureText'>measureText</a>(const void* text, size_t length, <a href='SkRect_Reference#SkRect'>SkRect</a>* bounds) const
</pre>
-Returns the advance width of <a href='#SkPaint_measureText_text'>text</a> if <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> is clear,
-and the height of <a href='#SkPaint_measureText_text'>text</a> if <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> is set.
+Returns the advance width of <a href='#SkPaint_measureText_text'>text</a>.
The advance is the normal distance to move before drawing additional <a href='#SkPaint_measureText_text'>text</a>.
Uses <a href='#Text_Encoding'>Text Encoding</a> to decode <a href='#SkPaint_measureText_text'>text</a>, <a href='undocumented#Typeface'>Typeface</a> to get the font metrics,
and <a href='#Text_Size'>Text Size</a>, <a href='#Text_Scale_X'>Text Scale X</a>, <a href='#Text_Skew_X'>Text Skew X</a>, <a href='#Stroke_Width'>Stroke Width</a>, and
@@ -4839,8 +4752,7 @@
<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPaint_measureText'>measureText</a>(const void* text, size_t length) const
</pre>
-Returns the advance width of <a href='#SkPaint_measureText_2_text'>text</a> if <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> is clear,
-and the height of <a href='#SkPaint_measureText_2_text'>text</a> if <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> is set.
+Returns the advance width of <a href='#SkPaint_measureText_2_text'>text</a>.
The advance is the normal distance to move before drawing additional <a href='#SkPaint_measureText_2_text'>text</a>.
Uses <a href='#Text_Encoding'>Text Encoding</a> to decode <a href='#SkPaint_measureText_2_text'>text</a>, <a href='undocumented#Typeface'>Typeface</a> to get the font metrics,
and <a href='#Text_Size'>Text Size</a> to scale the metrics.
@@ -4883,10 +4795,7 @@
</pre>
Returns the bytes of <a href='#SkPaint_breakText_text'>text</a> that fit within <a href='#SkPaint_breakText_maxWidth'>maxWidth</a>.
-If <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> is clear, the <a href='#SkPaint_breakText_text'>text</a> fragment fits if its advance width is less than or
-equal to <a href='#SkPaint_breakText_maxWidth'>maxWidth</a>.
-If <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> is set, the <a href='#SkPaint_breakText_text'>text</a> fragment fits if its advance height is less than or
-equal to <a href='#SkPaint_breakText_maxWidth'>maxWidth</a>.
+The <a href='#SkPaint_breakText_text'>text</a> fragment fits if its advance width is less than or equal to <a href='#SkPaint_breakText_maxWidth'>maxWidth</a>.
Measures only while the advance is less than or equal to <a href='#SkPaint_breakText_maxWidth'>maxWidth</a>.
Returns the advance or the <a href='#SkPaint_breakText_text'>text</a> fragment in <a href='#SkPaint_breakText_measuredWidth'>measuredWidth</a> if it not nullptr.
Uses <a href='#Text_Encoding'>Text Encoding</a> to decode <a href='#SkPaint_breakText_text'>text</a>, <a href='undocumented#Typeface'>Typeface</a> to get the font metrics,
@@ -4932,8 +4841,7 @@
Both <a href='#SkPaint_getTextWidths_widths'>widths</a> and <a href='#SkPaint_getTextWidths_bounds'>bounds</a> may be nullptr.
If <a href='#SkPaint_getTextWidths_widths'>widths</a> is not nullptr, <a href='#SkPaint_getTextWidths_widths'>widths</a> must be an array of glyph count entries.
if <a href='#SkPaint_getTextWidths_bounds'>bounds</a> is not nullptr, <a href='#SkPaint_getTextWidths_bounds'>bounds</a> must be an array of glyph count entries.
-If <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> is clear, <a href='#SkPaint_getTextWidths_widths'>widths</a> returns the horizontal advance.
-If <a href='#SkPaint_kVerticalText_Flag'>kVerticalText Flag</a> is set, <a href='#SkPaint_getTextWidths_widths'>widths</a> returns the vertical advance.
+Widths returns the horizontal advance.
Uses <a href='#Text_Encoding'>Text Encoding</a> to decode <a href='#SkPaint_getTextWidths_text'>text</a>, <a href='undocumented#Typeface'>Typeface</a> to get the font metrics,
and <a href='#Text_Size'>Text Size</a> to scale the <a href='#SkPaint_getTextWidths_widths'>widths</a> and <a href='#SkPaint_getTextWidths_bounds'>bounds</a>.
Does not scale the advance by <a href='#Fake_Bold'>Fake Bold</a> or <a href='undocumented#Path_Effect'>Path Effect</a>.
diff --git a/site/user/api/catalog.htm b/site/user/api/catalog.htm
index 8a9ca21..8c9460d 100644
--- a/site/user/api/catalog.htm
+++ b/site/user/api/catalog.htm
@@ -414,11 +414,11 @@
"stdout": "-----\\n---x-\\n---x-\\n---x-\\n---x-\\n---x-\\n---x-\\n-----\\n---x-\\n---x-\\n-----\\n"
},
"SkCanvas_empty_constructor": {
- "code": "// Returns true if either the canvas rotates the text by 90 degrees, or the paint does.\nstatic void check_for_up_and_down_text(const SkCanvas* canvas, const SkPaint& paint) {\n bool paintHasVertical = paint.isVerticalText();\n const SkMatrix& matrix = canvas->getTotalMatrix();\n bool matrixIsVertical = matrix.preservesRightAngles() && !matrix.isScaleTranslate();\n SkDebugf(\"paint draws text %s\\n\", paintHasVertical != matrixIsVertical ?\n \"top to bottom\" : \"left to right\");\n}\nstatic void check_for_up_and_down_text(const SkPaint& paint) {\n SkCanvas canvas; // placeholder only, does not have an associated device\n check_for_up_and_down_text(&canvas, paint);\n}\n\nvoid draw(SkCanvas* canvas) {\n SkPaint paint;\n check_for_up_and_down_text(paint); // paint draws text left to right\n paint.setVerticalText(true);\n check_for_up_and_down_text(paint); // paint draws text top to bottom\n paint.setVerticalText(false);\n canvas->rotate(90);\n check_for_up_and_down_text(canvas, paint); // paint draws text top to bottom\n}\n",
- "hash": "903451d6c93bf69e2833747a3e8cc8f7",
+ "code": "static void check_for_rotated_ctm(const SkCanvas* canvas) {\n const SkMatrix& matrix = canvas->getTotalMatrix();\n SkDebugf(\"rect stays rect is %s\\n\", matrix.rectStaysRect() ? \"true\" : \"false\");\n}\n\nvoid draw(SkCanvas* canvas) {\n check_for_rotated_ctm(canvas);\n canvas->rotate(30);\n check_for_rotated_ctm(canvas);\n SkCanvas defaultCanvas;\n check_for_rotated_ctm(&defaultCanvas);\n}\n",
+ "hash": "4a00e6589e862fde5be532f4b6e316ce",
"file": "SkCanvas_Reference",
"name": "SkCanvas::SkCanvas()",
- "stdout": "paint draws text left to right\\npaint draws text top to bottom\\npaint draws text top to bottom\\n"
+ "stdout": "rect stays rect is true\\nrect stays rect is false\\nrect stays rect is true\\n"
},
"SkCanvas_getBaseLayerSize": {
"code": "void draw(SkCanvas* ) {\n SkBitmap bitmap;\n bitmap.allocPixels(SkImageInfo::MakeN32Premul(20, 30));\n SkCanvas canvas(bitmap, SkSurfaceProps(0, kUnknown_SkPixelGeometry));\n canvas.clipRect(SkRect::MakeWH(10, 40));\n SkIRect clipDeviceBounds = canvas.getDeviceClipBounds();\n if (clipDeviceBounds.isEmpty()) {\n SkDebugf(\"Empty clip bounds is unexpected!\\n\");\n }\n SkDebugf(\"clip=%d,%d\\n\", clipDeviceBounds.width(), clipDeviceBounds.height());\n SkISize baseLayerSize = canvas.getBaseLayerSize();\n SkDebugf(\"size=%d,%d\\n\", baseLayerSize.width(), baseLayerSize.height());\n}",
@@ -1680,13 +1680,6 @@
"name": "SkPaint::isSubpixelText",
"stdout": "paint.isSubpixelText() == !!(paint.getFlags() & SkPaint::kSubpixelText_Flag)\\npaint.isSubpixelText() == !!(paint.getFlags() & SkPaint::kSubpixelText_Flag)\\n"
},
- "SkPaint_isVerticalText": {
- "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n SkDebugf(\"paint.isVerticalText() %c= !!(paint.getFlags() & SkPaint::kVerticalText_Flag)\\n\",\n paint.isVerticalText() == !!(paint.getFlags() & SkPaint::kVerticalText_Flag) ? '=' : '!');\n paint.setVerticalText(true);\n SkDebugf(\"paint.isVerticalText() %c= !!(paint.getFlags() & SkPaint::kVerticalText_Flag)\\n\",\n paint.isVerticalText() == !!(paint.getFlags() & SkPaint::kVerticalText_Flag) ? '=' : '!');\n}",
- "hash": "4a269b16e644d473870ffa873396f139",
- "file": "SkPaint_Reference",
- "name": "SkPaint::isVerticalText",
- "stdout": "paint.isVerticalText() == !!(paint.getFlags() & SkPaint::kVerticalText_Flag)\\npaint.isVerticalText() == !!(paint.getFlags() & SkPaint::kVerticalText_Flag)\\n"
- },
"SkPaint_measureText_2": {
"code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n SkDebugf(\"default width = %g\\n\", paint.measureText(\"!\", 1));\n paint.setTextSize(paint.getTextSize() * 2);\n SkDebugf(\"double width = %g\\n\", paint.measureText(\"!\", 1));\n}",
"hash": "f1139a5ddd17fd47c2f45f6e642cac76",
@@ -1932,13 +1925,6 @@
"name": "SkPaint::setTextSkewX",
"stdout": "text scale not-finite\\n"
},
- "SkPaint_setVerticalText": {
- "code": "void draw(SkCanvas* canvas) {\n SkPaint paint1, paint2;\n paint1.setVerticalText(true);\n paint2.setFlags(paint2.getFlags() | SkPaint::kVerticalText_Flag);\n SkDebugf(\"paint1 %c= paint2\\n\", paint1 == paint2 ? '=' : '!');\n}",
- "hash": "6fbd7e9e1a346cb8d7f537786009c736",
- "file": "SkPaint_Reference",
- "name": "SkPaint::setVerticalText",
- "stdout": "paint1 == paint2\\n"
- },
"SkPath_ConvertToNonInverseFillType": {
"code": "#define nameValue(fill) { SkPath::fill, #fill }\n\nvoid draw(SkCanvas* canvas) {\n struct {\n SkPath::FillType fill;\n const char* name;\n } fills[] = {\n nameValue(kWinding_FillType),\n nameValue(kEvenOdd_FillType),\n nameValue(kInverseWinding_FillType),\n nameValue(kInverseEvenOdd_FillType),\n };\n for (unsigned i = 0; i < SK_ARRAY_COUNT(fills); ++i) {\n if (fills[i].fill != (SkPath::FillType) i) {\n SkDebugf(\"fills array order does not match FillType enum order\");\n break;\n }\n SkDebugf(\"ConvertToNonInverseFillType(%s) == %s\\n\", fills[i].name,\n fills[(int) SkPath::ConvertToNonInverseFillType(fills[i].fill)].name);\n }\n}\n",
"hash": "319f6b124458dcc0f9ce4d7bbde65810",
@@ -4288,14 +4274,6 @@
"file": "SkPaint_Reference",
"name": "Text_Align"
},
- "Paint_Text_Align_a": {
- "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setTextSize(40);\n paint.setVerticalText(true);\n for (SkPaint::Align a : { SkPaint::kLeft_Align,\n SkPaint::kCenter_Align,\n SkPaint::kRight_Align }) {\n paint.setTextAlign(a);\n canvas->drawString(\"Aa\", 50, 80, paint);\n canvas->translate(50, 0);\n }\n}\n",
- "width": 256,
- "height": 160,
- "hash": "f1cbbbafe6b3c52b81309cccbf96a308",
- "file": "SkPaint_Reference",
- "name": "Text_Align_2"
-},
"Paint_Text_Encoding": {
"code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n const char hello8[] = \"Hello\" \"\\xE2\" \"\\x98\" \"\\xBA\";\n const uint16_t hello16[] = { 'H', 'e', 'l', 'l', 'o', 0x263A };\n const uint32_t hello32[] = { 'H', 'e', 'l', 'l', 'o', 0x263A };\n paint.setTextSize(24);\n canvas->drawText(hello8, sizeof(hello8) - 1, 10, 30, paint);\n paint.setTextEncoding(SkPaint::kUTF16_TextEncoding);\n canvas->drawText(hello16, sizeof(hello16), 10, 60, paint);\n paint.setTextEncoding(SkPaint::kUTF32_TextEncoding);\n canvas->drawText(hello32, sizeof(hello32), 10, 90, paint);\n uint16_t glyphs[SK_ARRAY_COUNT(hello32)];\n paint.textToGlyphs(hello32, sizeof(hello32), glyphs);\n paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);\n canvas->drawText(glyphs, sizeof(glyphs), 10, 120, paint);\n}\n",
"width": 256,
@@ -4336,14 +4314,6 @@
"file": "SkPaint_Reference",
"name": "Typeface_Methods"
},
- "Paint_Vertical_Text": {
- "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setTextSize(50);\n for (bool vertical : { false, true } ) {\n paint.setVerticalText(vertical);\n canvas->drawString(\"aAlL\", 25, 50, paint);\n }\n}\n",
- "width": 256,
- "height": 256,
- "hash": "8df5800819311b71373d9abb669b49b8",
- "file": "SkPaint_Reference",
- "name": "Vertical_Text"
-},
"Path_Arc": {
"code": "void draw(SkCanvas* canvas) {\n SkRect oval = {8, 8, 56, 56};\n SkPaint ovalPaint;\n ovalPaint.setAntiAlias(true);\n SkPaint textPaint(ovalPaint);\n ovalPaint.setStyle(SkPaint::kStroke_Style);\n SkPaint arcPaint(ovalPaint);\n arcPaint.setStrokeWidth(5);\n arcPaint.setColor(SK_ColorBLUE);\n canvas->translate(-64, 0);\n for (char arcStyle = '1'; arcStyle <= '6'; ++arcStyle) {\n '4' == arcStyle ? canvas->translate(-96, 55) : canvas->translate(64, 0);\n canvas->drawText(&arcStyle, 1, 30, 36, textPaint);\n canvas->drawOval(oval, ovalPaint);\n SkPath path;\n path.moveTo({56, 32});\n switch (arcStyle) {\n case '1':\n path.arcTo(oval, 0, 90, false);\n break;\n case '2':\n canvas->drawArc(oval, 0, 90, false, arcPaint);\n continue;\n case '3':\n path.addArc(oval, 0, 90);\n break;\n case '4':\n path.arcTo({56, 56}, {32, 56}, 24);\n break;\n case '5':\n path.arcTo({24, 24}, 0, SkPath::kSmall_ArcSize, SkPath::kCW_Direction, {32, 56});\n break;\n case '6':\n path.conicTo({56, 56}, {32, 56}, SK_ScalarRoot2Over2);\n break;\n }\n canvas->drawPath(path, arcPaint);\n }\n}\n",
"width": 256,