getSymbolSize function

Tuple2<int, int> getSymbolSize(
  1. String symbol
)

Returns the rendered ink size (width, height) of an FSW symbol key (e.g. S2e748), measured in the Sutton SignWriting Line font at size 30.

Mirrors Python signwriting.visualizer.visualize.get_symbol_size. Sizes are precomputed (see tool/generate_sizes.py) so this works without a font renderer. Returns (0, 0) for keys that have no existing ISWA glyph.

Implementation

Tuple2<int, int> getSymbolSize(String symbol) {
  final id = key2id(symbol);
  final i = id * 2;
  if (id < 0 || i + 1 >= _sizes.length) return const Tuple2(0, 0);
  return Tuple2(_sizes[i], _sizes[i + 1]);
}