mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2024-12-22 13:43:03 -05:00
d3c144e5e9
* color library * fixes * wip * wip * wip * wip * working * improvements * changeset * changeset * changeset & cleaning * changeset & cleaning * improvements * fixes * rebase
12 lines
372 B
TypeScript
12 lines
372 B
TypeScript
export const translateLetterSpacing = (
|
|
segment: Pick<StyledTextSegment, 'letterSpacing' | 'fontSize'>
|
|
): string => {
|
|
switch (segment.letterSpacing.unit) {
|
|
case 'PIXELS':
|
|
return segment.letterSpacing.value.toString();
|
|
case 'PERCENT':
|
|
return ((segment.fontSize * segment.letterSpacing.value) / 100).toString();
|
|
default:
|
|
return '0';
|
|
}
|
|
};
|