0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2024-12-22 21:53:27 -05:00
penpot-exporter-figma-plugin/plugin-src/translators/translateHorizontalAlign.ts
Jordi Sala Morales 881ccabe86
Added text basic properties (#61)
* fixes in text nodes

* fix comment

* allow design.penpot.app

* wip

* wip

* add position data

* wip agaaain

* added translate growtype

* use a random url just to get a 404 on gfonts call

* leave the config, just in case someone wants to try it

* translated line height & letter spacing; Created new type for text positionData

* text strokes

* several fixes

* compiled penpot lib with fix

* updated penpot lib

* fix lint

* remove proxy

* correctly translate font style

* fix grow type to reflect vertical trim

* Fix font segments

* remove comment

* changeset

---------

Co-authored-by: Alex Sánchez <sion333@gmail.com>
2024-04-29 10:17:08 +02:00

16 lines
380 B
TypeScript

import { TextHorizontalAlign } from '@ui/lib/types/text/textContent';
export const translateHorizontalAlign = (
align: 'LEFT' | 'CENTER' | 'RIGHT' | 'JUSTIFIED'
): TextHorizontalAlign => {
switch (align) {
case 'RIGHT':
return 'right';
case 'CENTER':
return 'center';
case 'JUSTIFIED':
return 'justify';
default:
return 'left';
}
};