chore: add mobile app

This commit is contained in:
2026-02-07 22:33:02 +01:00
parent db34640acc
commit e89384ad4e
29327 changed files with 3886944 additions and 12 deletions
+29
View File
@@ -0,0 +1,29 @@
import { UnavailabilityError } from 'expo-modules-core';
import { processColor } from 'react-native';
import ExpoFontUtils from './ExpoFontUtils';
import type { RenderToImageOptions, RenderToImageResult } from './FontUtils.types';
export type { RenderToImageOptions, RenderToImageResult };
/**
* Creates an image with provided text.
* @param glyphs Text to be exported.
* @param options RenderToImageOptions.
* @return Promise which fulfils with image metadata.
* @platform android
* @platform ios
*/
export async function renderToImageAsync(
glyphs: string,
options?: RenderToImageOptions
): Promise<RenderToImageResult> {
if (!ExpoFontUtils) {
throw new UnavailabilityError('expo-font', 'ExpoFontUtils.renderToImageAsync');
}
return await ExpoFontUtils.renderToImageAsync(glyphs, {
...options,
color: options?.color ? processColor(options.color) : undefined,
});
}