mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2025-01-09 08:30:08 -05:00
58f7b0ab2c
* moved validate font logic * google fonts working * fixes * minor improvements * fix linter * local fonts * fixes * Changeset * changeset * refactor * refactor * update branch * minor fix * move files around * try to refactor * refactor * add todo * refactor * refactor * refactor * refactor * refactor * refactor * refactor move files to their concrete location --------- Co-authored-by: Jordi Sala Morales <jordism91@gmail.com>
17 lines
563 B
TypeScript
17 lines
563 B
TypeScript
import slugify from 'slugify';
|
|
|
|
import { FontId } from '@ui/lib/types/text/textContent';
|
|
|
|
/**
|
|
* @TODO: implement custom font loading for Penpot
|
|
*/
|
|
export const translateCustomFont = (fontName: FontName): FontId | undefined => {
|
|
// For now display a message in the UI, so the user knows
|
|
// that the file is using a custom font not present in Penpot
|
|
figma.ui.postMessage({ type: 'FONT_NAME', data: fontName.family });
|
|
|
|
return {
|
|
fontId: slugify(fontName.family.toLowerCase()),
|
|
fontVariantId: fontName.style.toLowerCase().replace(/\s/g, '')
|
|
};
|
|
};
|