Skip to content

Options Reference

Complete reference for Fontisan's conversion options.

Opening Options

Opening options control how the source font is read and processed.

OptionTypeDescriptionUse Case
decompose_compositesBooleanDecompose composite glyphs into simple glyphsTarget format doesn't support composites
convert_curvesBooleanConvert curve types during conversionQuadratic ↔ Cubic conversion
scale_to_1000BooleanScale UPM to 1000Type 1 → OTF conversions
scale_from_1000BooleanScale from 1000 UPMOTF → TTF conversions
autohintBooleanAuto-hint the fontSource lacks hints or incompatible
generate_unicodeBooleanGenerate Unicode from glyph namesType 1 conversions
store_custom_tablesBooleanPreserve non-standard tablesCustom tables need preservation
store_native_hintingBooleanPreserve native hinting dataHints for source format
interpret_otBooleanInterpret OpenType layout featuresGSUB/GPOS processing needed
read_all_recordsBooleanLoad all font dictionary recordsType 1 with custom data
preserve_encodingStringPreserve character encodingCustom encoding required

Generating Options

Generating options control how the output font is written.

OptionTypeDescriptionUse Case
write_pfmBooleanWrite PFM fileType 1 output
write_afmBooleanWrite AFM fileType 1 output
write_infBooleanWrite INF fileType 1 output
select_encoding_automaticallyBooleanAuto-select encodingType 1 output
hinting_modeStringHint mode: preserve, auto, none, fullControl hinting
decompose_on_outputBooleanDecompose composites in outputTarget doesn't support composites
write_custom_tablesBooleanWrite custom tablesPreserve non-standard tables
optimize_tablesBooleanEnable table optimizationReduce file size
reencode_first_256BooleanReencode first 256 glyphsType 1 output
encoding_vectorStringCustom encoding vectorType 1 output
zlib_levelInteger (0–9)zlib compression level for WOFFWOFF output (default 6)
uncompressedBooleanStore WOFF tables uncompressed (legal per WOFF 1.0 §5.1)Tooling pipelines
compression_thresholdIntegerSkip compression for tables smaller than N bytesTiny-table edge cases
brotli_qualityInteger (0–11)Brotli quality for WOFF2WOFF2 output (default 11)
transform_tablesBooleanApply WOFF2 glyf/loca + hmtx transformationsSmaller WOFF2 output
metadata_xmlStringOptional WOFF metadata XML blockWOFF metadata block
private_dataStringOptional WOFF private data blockWOFF private block
preserve_metadataBooleanPreserve copyright/license metadataMaintain metadata
strip_metadataBooleanRemove metadataReduce file size
target_formatStringCollection target formatCollection conversions
curve_toleranceFloatCurve approximation toleranceOTF → TTF

Compression knobs come from each strategy's ConversionStrategy DSL declarations. Knobs that don't apply to the requested target format are rejected by FormatConverter.validate_options_for_target!.

CLI Option Mapping

Opening Options

bash
# Decompose composite glyphs
--decompose           # Enable decomposition
--no-decompose        # Preserve composite glyphs

# Curve conversion
--convert-curves      # Convert quadratic ↔ cubic

# UPM scaling
--scale-to-1000       # Scale to 1000 UPM
--scale-from-1000     # Scale from 1000 UPM

# Hinting
--autohint            # Apply automatic hinting

# Unicode and encoding
--generate-unicode    # Generate Unicode from glyph names
--preserve-encoding   # Preserve character encoding

# Table handling
--preserve-custom-tables  # Preserve non-standard tables
--interpret-ot            # Interpret OpenType tables

Generating Options

bash
# Type 1 metrics files
--write-pfm           # Generate PFM file
--write-afm           # Generate AFM file
--write-inf           # Generate INF file

# Encoding
--auto-encoding        # Auto-detect encoding
--encoding VECTOR      # Use specific encoding vector

# Hinting
--hinting-mode MODE   # preserve|auto|none|full

# Optimization
--optimize-tables      # Enable optimization
--no-optimization      # Disable optimization

# Metadata
--preserve-metadata    # Preserve copyright/license
--strip-metadata       # Remove metadata

# Collections
--target-format FORMAT # ttf|otf|preserve

# Curves
--curve-tolerance N   # Approximation tolerance (0.1-2.0)

# WOFF only (zlib)
--zlib-level=N              # 0–9, default 6
--uncompressed              # Store tables uncompressed (legal per WOFF 1.0 §5.1)
--compression-threshold=N   # Skip compression for tables < N bytes (default 100)

# WOFF2 only (Brotli)
--brotli-quality=N          # 0–11, default 11
--transform-tables          # Apply glyf/loca + hmtx transformations
--no-transform-tables       # Disable transformations (default)

Preset Option

bash
--preset NAME          # type1_to_modern, web_optimized, etc.

Hinting Modes

ModeDescriptionBest For
preserveKeep original hintsSame-format, compatible hints
autoApply automatic hintingCross-format, missing hints
noneRemove all hintsWeb fonts, smallest size
fullFull hint conversionPrint, maximum quality

preserve

ruby
generating: { hinting_mode: "preserve" }
  • Works best when source and target formats share hinting systems
  • TTF → TTF: TrueType instructions preserved
  • OTF → OTF: PostScript hints preserved
  • Cross-format: May result in lost hints

auto

ruby
generating: { hinting_mode: "auto" }
  • TTF → OTF: Autohinting applied to CFF output
  • OTF → TTF: Autohinting applied to TrueType output
  • Type 1 → Modern: Autohinting based on outlines

none

ruby
generating: { hinting_mode: "none" }
  • Smallest file size
  • No rendering optimizations
  • Useful when file size matters more than rendering

full

ruby
generating: { hinting_mode: "full" }
  • Attempts to preserve all hint information
  • May generate larger files
  • Best quality for print applications

Presets

type1_to_modern

Type 1 fonts to modern OpenType format.

ruby
Fontisan::ConversionOptions.from_preset(:type1_to_modern)
# From: :type1, To: :otf
# opening: { generate_unicode: true, decompose_composites: false }
# generating: { hinting_mode: "preserve", decompose_on_output: true }

modern_to_type1

Modern fonts to Type 1 format.

ruby
Fontisan::ConversionOptions.from_preset(:modern_to_type1)
# From: :otf, To: :type1
# opening: { convert_curves: true, scale_to_1000: true,
#           autohint: true }
# generating: { write_pfm: true, write_afm: true, write_inf: true }

web_optimized

Fonts optimized for web delivery.

ruby
Fontisan::ConversionOptions.from_preset(:web_optimized)
# From: :otf, To: :woff2
# opening: {}
# generating: { brotli_quality: 11, transform_tables: true,
#              optimize_tables: true, preserve_metadata: true }

legacy_web

WOFF with maximum zlib compression for legacy browser reach (IE 9+).

ruby
Fontisan::ConversionOptions.from_preset(:legacy_web)
# From: :otf, To: :woff
# generating: { zlib_level: 9, optimize_tables: true, preserve_metadata: true }

archive_to_modern

Collection extraction and modernization.

ruby
Fontisan::ConversionOptions.from_preset(:archive_to_modern)
# From: :ttc, To: :otf
# opening: { convert_curves: true, decompose_composites: false }
# generating: { target_format: "otf", hinting_mode: "preserve" }

Using Options

CLI

bash
# Show options before conversion
fontisan convert font.ttf --to otf --show-options

# Use preset
fontisan convert font.pfb --to otf --preset type1_to_modern

# Custom options
fontisan convert font.ttf --to otf \
  --autohint \
  --hinting-mode auto \
  --optimize-tables \
  --output font.otf

API

ruby
# Get recommended options
options = Fontisan::ConversionOptions.recommended(from: :ttf, to: :otf)

# Use preset
options = Fontisan::ConversionOptions.from_preset(:web_optimized)

# Build custom options
options = Fontisan::ConversionOptions.new(
  from: :ttf,
  to: :otf,
  opening: { autohint: true, convert_curves: true },
  generating: { hinting_mode: "auto", optimize_tables: true }
)

# Convert with options
converter = Fontisan::Converters::OutlineConverter.new
tables = converter.convert(font, options: options)

Fontisan is a [Ribose](https://open.ribose.com/) project