Lines Matching refs:CanvasKit
50 const paint = new CanvasKit.Paint();
52 paint.setColor(CanvasKit.RED);
53 paint.setStyle(CanvasKit.PaintStyle.Stroke);
55 const fontMgr = CanvasKit.FontMgr.FromData(notoSerifFontBuffer);
61 const paraStyle = new CanvasKit.ParagraphStyle({
63 color: CanvasKit.BLACK,
67 textAlign: CanvasKit.TextAlign.Center,
72 const builder = CanvasKit.ParagraphBuilder.Make(paraStyle, fontMgr);
75 const blueText = new CanvasKit.TextStyle({
76 backgroundColor: CanvasKit.Color(234, 208, 232), // light pink
77 color: CanvasKit.Color(48, 37, 199),
79 decoration: CanvasKit.LineThroughDecoration,
126 canvas.clear(CanvasKit.WHITE);
127 canvas.drawRect(CanvasKit.LTRBRect(10, 10, wrapTo+10, 230), paint);
137 const fontMgr = CanvasKit.FontMgr.FromData(notoSerifFontBuffer);
143 const paraStyle = new CanvasKit.ParagraphStyle({
145 foregroundColor: CanvasKit.Color4f(1.0, 0, 0, 0.8),
146 backgroundColor: CanvasKit.Color4f(0, 0, 1.0, 0.8),
152 textAlign: CanvasKit.TextAlign.Center,
154 const builder = CanvasKit.ParagraphBuilder.Make(paraStyle, fontMgr);
160 canvas.clear(CanvasKit.WHITE);
169 const fontMgr = CanvasKit.FontMgr.FromData(notoSerifFontBuffer);
179 const paraStyle = new CanvasKit.ParagraphStyle({
181 textAlign: CanvasKit.TextAlign.Center,
183 const builder = CanvasKit.ParagraphBuilder.Make(paraStyle, fontMgr);
185 const fg = new CanvasKit.Paint();
186 fg.setColor(CanvasKit.BLACK);
187 fg.setStyle(CanvasKit.PaintStyle.Stroke);
189 const bg = new CanvasKit.Paint();
190 bg.setColor(CanvasKit.TRANSPARENT);
198 canvas.clear(CanvasKit.WHITE);
211 const fontMgr = CanvasKit.FontMgr.FromData(notoSerifFontBuffer);
217 const paraStyle = new CanvasKit.ParagraphStyle({
226 textAlign: CanvasKit.TextAlign.Center,
228 const builder = CanvasKit.ParagraphBuilder.Make(paraStyle, fontMgr);
234 canvas.clear(CanvasKit.WHITE);
243 const fontMgr = CanvasKit.FontMgr.FromData(notoSerifFontBuffer);
249 const paraStyle = new CanvasKit.ParagraphStyle({
251 color: CanvasKit.WHITE,
254 shadows: [{color: CanvasKit.BLACK, blurRadius: 15},
255 {color: CanvasKit.RED, blurRadius: 5, offset: [10, 10]}],
258 textAlign: CanvasKit.TextAlign.Center,
260 const builder = CanvasKit.ParagraphBuilder.Make(paraStyle, fontMgr);
265 canvas.clear(CanvasKit.WHITE);
274 const fontMgr = CanvasKit.FontMgr.FromData(robotoFontBuffer);
280 const paraStrutStyle = new CanvasKit.ParagraphStyle({
283 color: CanvasKit.BLACK,
293 const paraStyle = new CanvasKit.ParagraphStyle({
296 color: CanvasKit.BLACK,
299 const roboto28Style = new CanvasKit.TextStyle({
300 color: CanvasKit.BLACK,
304 const roboto32Style = new CanvasKit.TextStyle({
305 color: CanvasKit.BLACK,
309 const builder = CanvasKit.ParagraphBuilder.Make(paraStrutStyle, fontMgr);
320 const builder2 = CanvasKit.ParagraphBuilder.Make(paraStyle, fontMgr);
337 canvas.clear(CanvasKit.WHITE);
347 const fontMgr = CanvasKit.FontMgr.FromData(robotoFontBuffer);
352 const paraStyle = new CanvasKit.ParagraphStyle({
354 color: CanvasKit.BLACK,
359 textAlign: CanvasKit.TextAlign.Center,
361 const builder = CanvasKit.ParagraphBuilder.Make(paraStyle, fontMgr);
366 canvas.clear(CanvasKit.WHITE);
375 const fontMgr = CanvasKit.FontMgr.FromData(robotoFontBuffer);
380 const paraStyle = new CanvasKit.ParagraphStyle({
382 color: CanvasKit.BLACK,
386 textAlign: CanvasKit.TextAlign.Center,
388 const builder = CanvasKit.ParagraphBuilder.Make(paraStyle, fontMgr);
390 builder.addPlaceholder(10, 10, CanvasKit.PlaceholderAlignment.AboveBaseline,
391 CanvasKit.TextBaseline.Ideographic);
395 builder.addPlaceholder(10, 10, CanvasKit.PlaceholderAlignment.BelowBaseline,
396 CanvasKit.TextBaseline.Ideographic);
407 canvas.clear(CanvasKit.WHITE);
411 const p = new CanvasKit.Paint();
412 p.setColor(CanvasKit.Color(0, 0, 255));
413 p.setStyle(CanvasKit.PaintStyle.Stroke);
416 CanvasKit.LTRBRect(rect[0]+10,rect[1]+10,rect[2]+10,rect[3]+10);
428 const fontMgr = CanvasKit.FontMgr.FromData(notoSerifFontBuffer);
431 const hStyle = CanvasKit.RectHeightStyle.Max;
432 const wStyle = CanvasKit.RectWidthStyle.Tight;
434 const mallocedColor = CanvasKit.Malloc(Float32Array, 4);
437 const paraStyle = new CanvasKit.ParagraphStyle({
443 textAlign: CanvasKit.TextAlign.Left,
446 const builder = CanvasKit.ParagraphBuilder.Make(paraStyle, fontMgr);
449 CanvasKit.Free(mallocedColor);
463 color: CanvasKit.Color(200, 0, 200),
469 color: CanvasKit.Color(255, 0, 0),
475 color: CanvasKit.Color(0, 255, 0),
481 color: CanvasKit.Color(0, 0, 255),
487 color: CanvasKit.Color(0, 200, 200),
490 canvas.clear(CanvasKit.WHITE);
501 expect(rect.direction.value).toEqual(CanvasKit.TextDirection.LTR.value);
502 const p = new CanvasKit.Paint();
504 p.setStyle(CanvasKit.PaintStyle.Stroke);
509 expect(CanvasKit.RectHeightStyle.Strut).toBeTruthy();
517 const fontMgr = CanvasKit.FontMgr.FromData([notoSerifFontBuffer, emojiFontBuffer]);
524 const paraStyle = new CanvasKit.ParagraphStyle({
526 color: CanvasKit.BLACK,
531 textAlign: CanvasKit.TextAlign.Left,
535 const textStyle = new CanvasKit.TextStyle({
536 color: CanvasKit.BLACK,
542 const builder = CanvasKit.ParagraphBuilder.Make(paraStyle, fontMgr);
554 canvas.clear(CanvasKit.WHITE);
557 const paint = new CanvasKit.Paint();
558 paint.setColor(CanvasKit.RED);
559 paint.setStyle(CanvasKit.PaintStyle.Stroke);
560 canvas.drawRect(CanvasKit.LTRBRect(10, 10, wrapTo+10, wrapTo+10), paint);
569 const fontMgr = CanvasKit.FontMgr.FromData([notoSerifFontBuffer]);
573 const paraStyle = new CanvasKit.ParagraphStyle({
575 color: CanvasKit.BLACK,
579 textAlign: CanvasKit.TextAlign.Left,
582 const builder = CanvasKit.ParagraphBuilder.Make(paraStyle, fontMgr);
588 canvas.clear(CanvasKit.WHITE);
592 const paint = new CanvasKit.Paint();
594 paint.setColor(CanvasKit.Color(255, 0, 0));
595 paint.setStyle(CanvasKit.PaintStyle.Fill);
598 paint.setColor(CanvasKit.Color(0, 0, 255));
601 paint.setColor(CanvasKit.Color(0, 255, 0));
607 affinity: CanvasKit.Affinity.Upstream
612 affinity: CanvasKit.Affinity.Downstream
617 affinity: CanvasKit.Affinity.Upstream
627 const paint = new CanvasKit.Paint();
629 paint.setColor(CanvasKit.RED);
630 paint.setStyle(CanvasKit.PaintStyle.Stroke);
632 … const fontMgr = CanvasKit.FontMgr.FromData(notoSerifFontBuffer, notoSerifBoldItalicFontBuffer);
636 const paraStyle = new CanvasKit.ParagraphStyle({
641 weight: CanvasKit.FontWeight.Light,
644 textDirection: CanvasKit.TextDirection.RTL,
648 const builder = CanvasKit.ParagraphBuilder.Make(paraStyle, fontMgr);
651 const boldItalic = new CanvasKit.TextStyle({
652 color: CanvasKit.RED,
656 weight: CanvasKit.FontWeight.Bold,
657 width: CanvasKit.FontWidth.Expanded,
658 slant: CanvasKit.FontSlant.Italic,
669 canvas.clear(CanvasKit.WHITE);
671 canvas.drawRect(CanvasKit.LTRBRect(10, 10, wrapTo+10, wrapTo+10), paint);
681 const paint = new CanvasKit.Paint();
683 paint.setColor(CanvasKit.RED);
684 paint.setStyle(CanvasKit.PaintStyle.Stroke);
687 const fontSrc = CanvasKit.TypefaceFontProvider.Make();
693 const paraStyle = new CanvasKit.ParagraphStyle({
698 weight: CanvasKit.FontWeight.Light,
701 textDirection: CanvasKit.TextDirection.RTL,
705 const builder = CanvasKit.ParagraphBuilder.MakeFromFontProvider(paraStyle, fontSrc);
708 const boldItalic = new CanvasKit.TextStyle({
709 color: CanvasKit.RED,
713 weight: CanvasKit.FontWeight.Bold,
714 width: CanvasKit.FontWidth.Expanded,
715 slant: CanvasKit.FontSlant.Italic,
726 canvas.clear(CanvasKit.WHITE);
728 canvas.drawRect(CanvasKit.LTRBRect(10, 10, wrapTo+10, wrapTo+10), paint);
738 const paint = new CanvasKit.Paint();
740 paint.setColor(CanvasKit.GREEN);
741 paint.setStyle(CanvasKit.PaintStyle.Stroke);
743 const fontMgr = CanvasKit.FontMgr.FromData(notoSerifFontBuffer);
749 const paraStyle = new CanvasKit.ParagraphStyle({
751 color: CanvasKit.BLACK,
754 decoration: CanvasKit.UnderlineDecoration,
756 decorationStyle: CanvasKit.DecorationStyle.Wavy,
760 const builder = CanvasKit.ParagraphBuilder.Make(paraStyle, fontMgr);
763 const blueText = new CanvasKit.TextStyle({
764 backgroundColor: CanvasKit.Color(234, 208, 232), // light pink
765 color: CanvasKit.Color(48, 37, 199),
767 textBaseline: CanvasKit.TextBaseline.Ideographic,
768 decoration: CanvasKit.LineThroughDecoration,
798 canvas.clear(CanvasKit.WHITE);
799 canvas.drawRect(CanvasKit.LTRBRect(10, 10, wrapTo+10, 230), paint);
809 const fontMgr = CanvasKit.FontMgr.FromData(notoSerifFontBuffer);
815 const paraStyle = new CanvasKit.ParagraphStyle({
817 color: CanvasKit.BLACK,
818 backgroundColor: CanvasKit.Color(234, 208, 232), // light pink
825 const builder = CanvasKit.ParagraphBuilder.Make(paraStyle, fontMgr);
828 const halfLeadingText = new CanvasKit.TextStyle({
829 color: CanvasKit.Color(48, 37, 199),
830 backgroundColor: CanvasKit.Color(234, 208, 232), // light pink
841 canvas.clear(CanvasKit.WHITE);
850 const fontMgr = CanvasKit.FontMgr.FromData(notoSerifFontBuffer);
853 canvas.clear(CanvasKit.WHITE);
854 const paint = new CanvasKit.Paint();
855 paint.setColor(CanvasKit.RED);
856 paint.setStyle(CanvasKit.PaintStyle.Stroke);
862 const style = new CanvasKit.ParagraphStyle({
864 color: CanvasKit.BLACK,
869 textHeightBehavior: CanvasKit.TextHeightBehavior[behaviors[i]],
871 const builder = CanvasKit.ParagraphBuilder.Make(style, fontMgr);
876 canvas.drawRect(CanvasKit.LTRBRect(0, 150 * i, wrapTo, 150 * i + 120), paint);
885 const surface = CanvasKit.MakeCanvasSurface('test');
889 const paint = new CanvasKit.Paint();
891 paint.setColor(CanvasKit.RED);
892 paint.setStyle(CanvasKit.PaintStyle.Stroke);
894 … const fontMgr = CanvasKit.FontMgr.FromData(notoSerifFontBuffer, notoSerifBoldItalicFontBuffer);
898 const paraStyle = new CanvasKit.ParagraphStyle({
903 textDirection: CanvasKit.TextDirection.RTL,
907 const builder = CanvasKit.ParagraphBuilder.Make(paraStyle, fontMgr);
910 const boldItalic = new CanvasKit.TextStyle({
912 weight: CanvasKit.FontWeight.Bold,
913 slant: CanvasKit.FontSlant.Italic,
924 canvas.clear(CanvasKit.WHITE);
925 canvas.drawRect(CanvasKit.LTRBRect(10, 10, wrapTo+10, wrapTo+10), paint);
937 const surface = CanvasKit.MakeCanvasSurface('test');
941 const paint = new CanvasKit.Paint();
943 paint.setColor(CanvasKit.RED);
944 paint.setStyle(CanvasKit.PaintStyle.Stroke);
946 … const fontMgr = CanvasKit.FontMgr.FromData(notoSerifFontBuffer, notoSerifBoldItalicFontBuffer);
950 const paraStyle = new CanvasKit.ParagraphStyle({
954 textDirection: CanvasKit.TextDirection.RTL,
958 const builder = CanvasKit.ParagraphBuilder.Make(paraStyle, fontMgr);
961 const boldItalic = new CanvasKit.TextStyle({
963 weight: CanvasKit.FontWeight.Bold,
964 slant: CanvasKit.FontSlant.Italic,
975 canvas.clear(CanvasKit.WHITE);
976 canvas.drawRect(CanvasKit.LTRBRect(10, 10, wrapTo+10, wrapTo+10), paint);