@@ -524,7 +524,7 @@ typeface
524524 .def (" unicharsToGlyphs" ,
525525 [] (const SkTypeface& typeface, const std::vector<SkUnichar>& chars) {
526526 std::vector<SkGlyphID> glyphs (chars.size ());
527- typeface.unicharsToGlyphs ({& chars[ 0 ] , chars.size ()}, {& glyphs[ 0 ] , glyphs.size ()});
527+ typeface.unicharsToGlyphs ({chars. data () , chars.size ()}, {glyphs. data () , glyphs.size ()});
528528 return glyphs;
529529 },
530530 R"docstring(
@@ -556,7 +556,7 @@ typeface
556556 .def (" getTableTags" ,
557557 [] (const SkTypeface& typeface) {
558558 std::vector<SkFontTableTag> tags (typeface.countTables ());
559- size_t size = typeface.readTableTags ({& tags[ 0 ] , tags.size ()});
559+ size_t size = typeface.readTableTags ({tags. data () , tags.size ()});
560560 if (size < tags.size ())
561561 throw std::runtime_error (" Failed to get table tags." );
562562 return tags;
@@ -613,7 +613,7 @@ typeface
613613 const std::vector<SkGlyphID>& glyphs) -> py::object {
614614 std::vector<int32_t > adjustments (glyphs.size () - 1 );
615615 auto result = typeface.getKerningPairAdjustments (
616- {& glyphs[ 0 ] , glyphs.size ()}, {(glyphs.size () > 1 ) ? & adjustments[ 0 ] : nullptr , adjustments.size ()});
616+ {glyphs. data () , glyphs.size ()}, {(glyphs.size () > 1 ) ? adjustments. data () : nullptr , adjustments.size ()});
617617 if (!result) {
618618 // Kerning is not supported for this typeface.
619619 return py::none ();
@@ -1312,10 +1312,10 @@ font
13121312 .def (" textToGlyphs" ,
13131313 [] (const SkFont& font, const std::string& text,
13141314 SkTextEncoding encoding) {
1315- int count = font.countText (& text[ 0 ] , text.size (), encoding);
1315+ int count = font.countText (text. data () , text.size (), encoding);
13161316 std::vector<SkGlyphID> glyphs (count);
13171317 font.textToGlyphs (
1318- & text[ 0 ] , text.size (), encoding, {& glyphs[ 0 ] , glyphs.size ()});
1318+ text. data () , text.size (), encoding, {glyphs. data () , glyphs.size ()});
13191319 return glyphs;
13201320 },
13211321 R"docstring(
@@ -1355,14 +1355,14 @@ font
13551355 .def (" unicharsToGlyphs" ,
13561356 [] (const SkFont& font, const std::vector<SkUnichar>& uni) {
13571357 std::vector<SkGlyphID> glyphs (uni.size ());
1358- font.unicharsToGlyphs ({& uni[ 0 ] , uni.size ()}, {& glyphs[ 0 ] , glyphs.size ()});
1358+ font.unicharsToGlyphs ({uni. data () , uni.size ()}, {glyphs. data () , glyphs.size ()});
13591359 return glyphs;
13601360 },
13611361 py::arg (" uni" ))
13621362 .def (" countText" ,
13631363 [] (const SkFont& font, const std::string& text,
13641364 SkTextEncoding encoding) {
1365- return font.countText (& text[ 0 ] , text.size (), encoding);
1365+ return font.countText (text. data () , text.size (), encoding);
13661366 },
13671367 R"docstring(
13681368 Returns number of glyphs represented by text.
@@ -1380,7 +1380,7 @@ font
13801380 [] (const SkFont& font, const std::string& text,
13811381 SkTextEncoding encoding, SkRect* bounds, const SkPaint* paint) {
13821382 return font.measureText (
1383- & text[ 0 ] , text.size (), encoding, bounds, paint);
1383+ text. data () , text.size (), encoding, bounds, paint);
13841384 },
13851385 R"docstring(
13861386 Returns the advance width of text.
@@ -1402,7 +1402,7 @@ font
14021402 .def (" getWidths" ,
14031403 [] (const SkFont& font, const std::vector<SkGlyphID>& glyphs) {
14041404 std::vector<SkScalar> width (glyphs.size ());
1405- font.getWidths ({& glyphs[ 0 ] , glyphs.size ()}, {& width[ 0 ] , width.size ()});
1405+ font.getWidths ({glyphs. data () , glyphs.size ()}, {width. data () , width.size ()});
14061406 return width;
14071407 },
14081408 R"docstring(
@@ -1418,7 +1418,7 @@ font
14181418 std::vector<SkScalar> width (glyphs.size ());
14191419 std::vector<SkRect> bounds (glyphs.size ());
14201420 font.getWidthsBounds (
1421- {& glyphs[ 0 ] , glyphs.size ()}, {& width[ 0 ] , width.size ()}, {& bounds[ 0 ] , bounds.size ()}, paint);
1421+ {glyphs. data () , glyphs.size ()}, {width. data () , width.size ()}, {bounds. data () , bounds.size ()}, paint);
14221422 return py::make_tuple (width, bounds);
14231423 },
14241424 R"docstring(
@@ -1435,7 +1435,7 @@ font
14351435 [] (const SkFont& font, const std::vector<SkGlyphID>& glyphs,
14361436 const SkPaint* paint) {
14371437 std::vector<SkRect> bounds (glyphs.size ());
1438- font.getBounds ({& glyphs[ 0 ] , glyphs.size ()}, {& bounds[ 0 ] , bounds.size ()}, paint);
1438+ font.getBounds ({glyphs. data () , glyphs.size ()}, {bounds. data () , bounds.size ()}, paint);
14391439 return bounds;
14401440 },
14411441 R"docstring(
@@ -1455,7 +1455,7 @@ font
14551455 [] (const SkFont& font, const std::vector<SkGlyphID>& glyphs,
14561456 const SkPoint& origin) {
14571457 std::vector<SkPoint> pos (glyphs.size ());
1458- font.getPos ({& glyphs[ 0 ] , glyphs.size ()}, {& pos[ 0 ] , pos.size ()}, origin);
1458+ font.getPos ({glyphs. data () , glyphs.size ()}, {pos. data () , pos.size ()}, origin);
14591459 return pos;
14601460 },
14611461 R"docstring(
@@ -1473,7 +1473,7 @@ font
14731473 [] (const SkFont& font, const std::vector<SkGlyphID>& glyphs,
14741474 const SkScalar& origin) {
14751475 std::vector<SkScalar> xpos (glyphs.size ());
1476- font.getXPos ({& glyphs[ 0 ] , glyphs.size ()}, {& xpos[ 0 ] , xpos.size ()}, origin);
1476+ font.getXPos ({glyphs. data () , glyphs.size ()}, {xpos. data () , xpos.size ()}, origin);
14771477 return xpos;
14781478 },
14791479 R"docstring(
0 commit comments