wspr/fontspec — Issue #121: Support font independent Unicode whitespace characters
Author: PanderMusubi
Created: 2011-11-19 17:14:46+00:00
State: open

Please support font independent Unicode whitespace characters. these characters have zero width adn their behaviour does not depend on the font used. Nevertehless, at the moment the actual use of these characters is depending on the font used.

Below is a test that needs to be improved (probably al least because the special characters have disappeared while copy pasting this here). This test needs to be run for several high quality and several poor quality TTF and OTF fonts. Then it will be clear that they are not always working as expected.

Fontspec should catch the use of these characters and always trigger the correct effects in XeLaTeX (of LuaTeX for that matter). Be it by leaving it to the font of calling TeX macros. The effect by they should be as Unicode preserving as much as possible so that by copying from teh resulting PDF, these Unicode characters are also available.

\documentclass{article}
\usepackage{fontspec}
\usepackage{hyperref}
\begin{document}
\fontspec{FreeSerif}%FIXME test this with many fonts
{\bfseries Testing font independent Unicode whitespace characters support}\\

U+00A0 NO-BREAK SPACE (NBSP)\\\\
\href{https://en.wikipedia.org/wiki/No-Break\_Space}{https://en.wikipedia.org/wiki/No-Break\_Space}\\\\
ABCDEFGHIJKLMNOPQRSTUVWXYZ\\\\%FIXME add proper test

U+00AD SOFT HYPHEN\\\\
\href{https://en.wikipedia.org/wiki/Soft\_hyphen}{https://en.wikipedia.org/wiki/Soft\_hyphen}\\\\
Pac-Man goes "wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka­wocka."\\\\%FIXME optmise test

U+200B ZERO WIDTH SPACE (ZWSP)\\\\
\href{https://en.wikipedia.org/wiki/Zero-width\_space}{https://en.wikipedia.org/wiki/Zero-width\_space}\\\\
Antidisestablishmentarianism​Antidisestablishmentarianism​​​Antidisestablishmentarianism​Antidisestablishmentarianism​​Antidisestablishmentarianism​Antidisestablishmentarianism​​Antidisestablishmentarianism​Antidisestablishmentarianism​​Antidisestablishmentarianism\\\\%FIXME optmise test

U+200C ZERO WIDTH NON-JOINER (ZWNJ)\\\\
\href{https://en.wikipedia.org/wiki/Zero-width\_non-joiner}{https://en.wikipedia.org/wiki/Zero-width\_non-joiner}\\\\
Auf‌lage\\\\%FIXME optimise test

U+200D ZERO WIDTH JOINER (ZWJ)\\\\
\href{https://en.wikipedia.org/wiki/Zero-width\_joiner}{https://en.wikipedia.org/wiki/Zero-width\_joiner}\\\\
ABCDEFGHIJKLMNOPQRSTUVWXYZ\\\\%FIXME add proper test

U+2060 WORD JOINER (WJ)\\\\
\href{https://en.wikipedia.org/wiki/Word\_Joiner\#Spaces\_in\_Unicode}{https://en.wikipedia.org/wiki/Word\_Joiner\#Spaces\_in\_Unicode}\\\\
ABCDEFGHIJKLMNOPQRSTUVWXYZ\\\\%FIXME add proper test

U+FEFF ZERO WIDTH NO-BREAK SPACE\\\\
deprecated

\end{document}