UNPKG

@shopify/react-native-skia

Version:

High-performance React Native Graphics using Skia

21 lines (17 loc) 896 B
import { Host } from "./Host"; import { JsiSkParagraphBuilder } from "./JsiSkParagraphBuilder"; import { JsiSkParagraphStyle } from "./JsiSkParagraphStyle"; import { JsiSkTypeface } from "./JsiSkTypeface"; export class JsiSkParagraphBuilderFactory extends Host { constructor(CanvasKit) { super(CanvasKit); } Make(paragraphStyle, typefaceProvider) { const style = new this.CanvasKit.ParagraphStyle(JsiSkParagraphStyle.toParagraphStyle(this.CanvasKit, paragraphStyle !== null && paragraphStyle !== void 0 ? paragraphStyle : {})); if (typefaceProvider === undefined) { throw new Error("SkTypefaceFontProvider is required on React Native Web."); } return new JsiSkParagraphBuilder(this.CanvasKit, this.CanvasKit.ParagraphBuilder.MakeFromFontProvider(style, JsiSkTypeface.fromValue(typefaceProvider))); } } //# sourceMappingURL=JsiSkParagraphBuilderFactory.js.map