How to use the @sketch-hq/sketch-file-format-ts.FileFormat1.UnderlineStyle function in @sketch-hq/sketch-file-format-ts

To help you get started, we’ve selected a few @sketch-hq/sketch-file-format-ts examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github airbnb / react-sketchapp / src / jsonUtils / textLayers.ts View on Github external
import { FileFormat1 as FileFormat } from '@sketch-hq/sketch-file-format-ts';
import makeResizeConstraint from './resizeConstraint';
import { TextNode, ResizeConstraints, TextStyle, ViewStyle } from '../types';
import { generateID, makeColorFromCSS } from './models';
import { makeStyle, parseStyle } from './style';

import findFontName from '../utils/findFont';

export const TEXT_DECORATION_UNDERLINE = {
  none: FileFormat.UnderlineStyle.None,
  underline: FileFormat.UnderlineStyle.Underlined,
  double: 9,
};

export const TEXT_ALIGN = {
  auto: FileFormat.TextHorizontalAlignment.Left,
  left: FileFormat.TextHorizontalAlignment.Left,
  right: FileFormat.TextHorizontalAlignment.Right,
  center: FileFormat.TextHorizontalAlignment.Centered,
  justify: FileFormat.TextHorizontalAlignment.Justified,
};

const TEXT_ALIGN_REVERSE = {
  [FileFormat.TextHorizontalAlignment.Right]: 'right',
  [FileFormat.TextHorizontalAlignment.Centered]: 'center',
  [FileFormat.TextHorizontalAlignment.Justified]: 'justify',
};
github airbnb / react-sketchapp / src / jsonUtils / textLayers.ts View on Github external
import { FileFormat1 as FileFormat } from '@sketch-hq/sketch-file-format-ts';
import makeResizeConstraint from './resizeConstraint';
import { TextNode, ResizeConstraints, TextStyle, ViewStyle } from '../types';
import { generateID, makeColorFromCSS } from './models';
import { makeStyle, parseStyle } from './style';

import findFontName from '../utils/findFont';

export const TEXT_DECORATION_UNDERLINE = {
  none: FileFormat.UnderlineStyle.None,
  underline: FileFormat.UnderlineStyle.Underlined,
  double: 9,
};

export const TEXT_ALIGN = {
  auto: FileFormat.TextHorizontalAlignment.Left,
  left: FileFormat.TextHorizontalAlignment.Left,
  right: FileFormat.TextHorizontalAlignment.Right,
  center: FileFormat.TextHorizontalAlignment.Centered,
  justify: FileFormat.TextHorizontalAlignment.Justified,
};

const TEXT_ALIGN_REVERSE = {
  [FileFormat.TextHorizontalAlignment.Right]: 'right',
  [FileFormat.TextHorizontalAlignment.Centered]: 'center',
  [FileFormat.TextHorizontalAlignment.Justified]: 'justify',