|
1 | 1 | #include "include/context2d.hpp" |
| 2 | +#include "include/utils/SkParsePath.h" |
| 3 | +#include "include/core/SkMatrix.h" |
| 4 | +#include "include/core/SkPaint.h" |
| 5 | +#include "include/core/SkBitmap.h" |
| 6 | +#include <iostream> |
| 7 | +#include <vector> |
| 8 | +#include "include/core/SkFontMgr.h" |
| 9 | +#include "include/core/SkColorSpace.h" |
| 10 | +#include "include/core/SkBlurTypes.h" |
| 11 | +#include "modules/skparagraph/include/FontCollection.h" |
| 12 | +#include "modules/skparagraph/include/ParagraphStyle.h" |
| 13 | +#include "modules/skparagraph/include/ParagraphBuilder.h" |
| 14 | +#include "modules/skparagraph/src/ParagraphBuilderImpl.h" |
| 15 | +#include "modules/skparagraph/src/ParagraphImpl.h" |
| 16 | +#include "include/effects/SkColorMatrix.h" |
| 17 | +#include "include/effects/SkDashPathEffect.h" |
| 18 | +#include "include/effects/SkImageFilters.h" |
| 19 | +#include "include/path2d.hpp" |
| 20 | +#include "include/core/SkMaskFilter.h" |
| 21 | +#include "deps/csscolorparser.hpp" |
2 | 22 |
|
3 | 23 | #ifndef _USE_MATH_DEFINES |
4 | 24 | #define _USE_MATH_DEFINES |
@@ -435,6 +455,9 @@ extern "C" { |
435 | 455 | out_metrics->width = lineWidth; |
436 | 456 | out_metrics->font_ascent = -font_metrics.fAscent + offset; |
437 | 457 | out_metrics->font_descent = font_metrics.fDescent + offset; |
| 458 | + out_metrics->alphabetic_baseline = -font_metrics.fAscent + offset; |
| 459 | + out_metrics->ideographic_baseline = -paragraph->getIdeographicBaseline() + offset; |
| 460 | + out_metrics->hanging_baseline = -paragraph->getAlphabeticBaseline() + offset; |
438 | 461 | } else { |
439 | 462 | auto needScale = lineWidth > maxWidth; |
440 | 463 | auto ratio = needScale ? maxWidth / lineWidth : 1.0; |
@@ -499,9 +522,9 @@ extern "C" { |
499 | 522 | return res; |
500 | 523 | } |
501 | 524 |
|
502 | | - // Context.fillText() implementation in JS using sk_context_test |
503 | | - // Context.strokeText() implementation in JS using sk_context_test |
504 | | - // Context.measureText() implementation in JS using sk_context_test |
| 525 | + // Context.fillText() implementation in JS using sk_context_text |
| 526 | + // Context.strokeText() implementation in JS using sk_context_text |
| 527 | + // Context.measureText() implementation in JS using sk_context_text |
505 | 528 |
|
506 | 529 | /// Line styles |
507 | 530 |
|
|
0 commit comments