UNPKG

@compdfkit_pdf_sdk/react_native

Version:

ComPDFKit for React Native is a comprehensive SDK that allows you to quickly add PDF functionality to Android, iOS, and React Native applications.

37 lines 1.44 kB
"use strict"; /** * Copyright © 2014-2026 PDF Technologies, Inc. All Rights Reserved. * * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT. * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES. * This notice may not be removed from this file. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.CPDFFontName = void 0; class CPDFFontName { familyName; styleNames; constructor({ familyName = '', styleNames = [] } = {}) { this.familyName = familyName; this.styleNames = styleNames; } // Create a CPDFFontName from a JSON-like object returned by native/platform code. // Expected keys: `familyName` (string), `styleNames` (string[]) static fromJson(json) { const familyName = typeof json?.familyName === 'string' ? json.familyName : ''; const styleNames = Array.isArray(json?.styleNames) ? json.styleNames.filter((v) => typeof v === 'string') : []; return new CPDFFontName({ familyName, styleNames }); } toJson() { return { familyName: this.familyName, styleNames: this.styleNames, }; } } exports.CPDFFontName = CPDFFontName; exports.default = CPDFFontName; //# sourceMappingURL=CPDFFontName.js.map