function unicode_conversion_map in Typogrify 6
Same name and namespace in other branches
- 7 unicode-conversion.php \unicode_conversion_map()
Return the unicode conversion maps.
Parameters
string $type: The map type we're looking for, one of 'ligature', 'punctuation', 'arrow' 'nested' or 'all'.
Return value
array Array of conversions, keyed by the original string.
4 calls to unicode_conversion_map()
- convert_characters in ./
unicode-conversion.php - Perform character conversion.
- _typogrify_default_settings in ./
typogrify.module - Return the default settings.
- _typogrify_process in ./
typogrify.module - Processing function to apply the Typogrify filters
- _typogrify_settings in ./
typogrify.module - Typogrify filter settings form.
File
- ./
unicode-conversion.php, line 12
Code
function unicode_conversion_map($type = 'all') {
$map = array(
// See http://www.unicode.org/charts/PDF/UFB00.pdf
'ligature' => array(
'ffi' => 'ffi',
'ffl' => 'ffl',
'ff' => 'ff',
'fi' => 'fi',
'fl' => 'fl',
'ij' => 'ij',
'IJ' => 'IJ',
'st' => 'st',
'ss' => 'ß',
),
// See http:#www.unicode.org/charts/PDF/U2000.pdf
'punctuation' => array(
'...' => '…',
'..' => '‥',
'. . .' => '…',
'---' => '—',
'--' => '–',
),
// See http:#www.unicode.org/charts/PDF/U2190.pdf
'arrow' => array(
'->>' => '↠',
'<<-' => '↞',
'->|' => '⇥',
'|<-' => '⇤',
'<->' => '↔',
'->' => '→',
'<-' => '←',
'<=>' => '⇔',
'=>' => '⇒',
'<=' => '⇐',
),
);
if ($type == 'all') {
return array_merge($map['ligature'], $map['arrow'], $map['punctuation']);
}
elseif ($type == 'nested') {
return $map;
}
else {
return $map[$type];
}
}