UNPKG

@shopify/react-native-skia

Version:

High-performance React Native Graphics using Skia

34 lines (23 loc) 1.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.JsiSkParagraphBuilderFactory = void 0; var _Host = require("./Host"); var _JsiSkParagraphBuilder = require("./JsiSkParagraphBuilder"); var _JsiSkParagraphStyle = require("./JsiSkParagraphStyle"); var _JsiSkTypeface = require("./JsiSkTypeface"); class JsiSkParagraphBuilderFactory extends _Host.Host { constructor(CanvasKit) { super(CanvasKit); } Make(paragraphStyle, typefaceProvider) { const style = new this.CanvasKit.ParagraphStyle(_JsiSkParagraphStyle.JsiSkParagraphStyle.toParagraphStyle(this.CanvasKit, paragraphStyle ?? {})); if (typefaceProvider === undefined) { throw new Error("SkTypefaceFontProvider is required on React Native Web."); } return new _JsiSkParagraphBuilder.JsiSkParagraphBuilder(this.CanvasKit, this.CanvasKit.ParagraphBuilder.MakeFromFontProvider(style, _JsiSkTypeface.JsiSkTypeface.fromValue(typefaceProvider))); } } exports.JsiSkParagraphBuilderFactory = JsiSkParagraphBuilderFactory; //# sourceMappingURL=JsiSkParagraphBuilderFactory.js.map