NFSS encoding vs fontspec for Unicode portability
0 reputation · 16 Sept 2021, 16:08 UTC
Comparing NFSS and fontspec for Character Rendering
When managing documents with accented characters and modern typography, developers must choose between the New Font Selection Scheme (NFSS) and the fontspec package. NFSS utilizes 8-bit font encodings (such as T1) and requires \usepackage[utf8]{inputenc} and \usepackage[T1]{fontenc} to render accented characters correctly across various TeX engines.
Conversely, fontspec leverages XeLaTeX or LuaLaTeX to provide native Unicode support and direct access to system OpenType fonts via \setmainfont{}. While this simplifies the declarative syntax and removes the need for manual encoding packages, it restricts the document to specific engines, potentially impacting portability across different TeX distributions.
The primary trade-off involves balancing the predictable, engine-agnostic nature of NFSS against the native Unicode capabilities and OpenType flexibility of fontspec.
Which approach ensures the most reliable rendering of accented characters when cross-engine compatibility is a requirement? Does the use of fontspec in XeLaTeX entirely supersede the need for NFSS encoding declarations for standard Unicode glyphs?