mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2024-12-22 21:53:27 -05:00
d3c144e5e9
* color library * fixes * wip * wip * wip * wip * working * improvements * changeset * changeset * changeset & cleaning * changeset & cleaning * improvements * fixes * rebase
19 lines
640 B
TypeScript
19 lines
640 B
TypeScript
import { translateFontWeight } from '@plugin/translators/text/properties';
|
|
|
|
import { TextTypography } from '@ui/lib/types/shapes/textShape';
|
|
|
|
import { translateCustomFont } from './custom';
|
|
import { translateGoogleFont } from './gfonts';
|
|
import { translateLocalFont } from './local';
|
|
|
|
export const translateFontName = (
|
|
fontName: FontName
|
|
): Pick<TextTypography, 'fontId' | 'fontVariantId' | 'fontWeight'> | undefined => {
|
|
const fontWeight = translateFontWeight(fontName);
|
|
|
|
return (
|
|
translateGoogleFont(fontName, fontWeight) ??
|
|
translateLocalFont(fontName, fontWeight) ??
|
|
translateCustomFont(fontName, fontWeight)
|
|
);
|
|
};
|