## Samples.catalog

Ucode sample viewer, by Ken Shillito
Sample Unicode strings....
(click any of those below to view it)
Simple placement of lone diacritics
Hebrew I - &#X05D0;/&#X05DC; + markings
Hebrew II - &#XFB2A;/&#XFB2B;/terminals/rafe
Hebrew III - dagesh, metheg, etc.
Arabic I - character forming
Arabic II - punctuation mirroring
##10
Indic Scripts
Merging Diacritics
Kerning and wrapping diacritics
Double diacritics
Individual under/overlines
Multiple diacritics
Decomposing
Forced under/overlines
Small caps, old-style nums
Tilting, Emboldening
##20
Monospacing
Justification, ASCII
Tabbing
Jam 1
Kerning
Dingbats, etc.
Unicode bidi
Soft hyphens
Font grabbing
Manual input
##30
Simple placement of lone diacritics.
Diacritics are shown here with a dummy glyph in the centre.
~Common placements are: above left/middle/right; left; right; and
~below left/middle/right. Each of these tight or loose.
~(there is no left tight).
Hebrew I - &#X05D0;/&#X05DC; + pointings
Hebrew has complex rules for placing dagesh/mapiq within
~characters, relative positions of vowel points, cantillation
~marks and siluq. Lamedh has special placement rules.
Hebrew II -&#XFB2A;/&#XFB2B;, Terminal forms, Rafe
Sin and Shin present problems with holam (the placement of
~holam here looks ugly but is in accord with Unicode rules).
~Ucode must use terminal forms where required, and sort rafe
~and other diacritical marks into the correct order.
Hebrew III - Dagesh/Mappiq, metheg, etc.
Ucode must put dagesh/mappiq into its right place, place
~metheg into its right place, and deal with further sorting
~out of cantillation marks.
~I included some underlining and a box in the 4th line.
Arabic I  - Character shaping
Arabic has complex rules for character shaping. Line 1
~is an alphabet with forming suppressed; line 2 with shaping
~normal. Line 3 shows alif/lam ligatures.
##40
Arabic II - rtl mirroring of punctuation
rtl languages (Hebrew, Arabic) mirror certain individual and
~paired punctuation. ltr do not. Ucode detects when mirroring
~is required, and does it automatically. The 3rd line has some
~enclosing diacritics, to show that Ucode does the joins ok.
Indic scripts
Some Indic scripts hang characters down from the line, with
~character forms varying depending on the context. Here
~are samples from these scripts. Some enclosing diacritics are
~included in order to show that Ucode joins through them ok.
Merging diacritics
Here are diacritics which occur over Latin or Greek
~characters, which interact with each others&rsquo; positioning.
~Ucode detects these, regardless of their order/context.
Kerning and wrapping diacritics
Some diacritics kern with their principal characters, or
~enclose them horizontally or vertically. Here are examples
~of each. In some cases, Ucode must also join the characters.
Double diacritics
Diacritics 0360 to 0362 cover two characters. Double
~diacritics are drawn in both character boxes, and have pixels
~between the boxes as in Arabic and Indic joiners. You will note
~that ucode.library does double diacritics ok for rtl Unicode.
##50
Individual under/overlines, strike throughs
You can direct Ucode to do under/overlines/strike throughs on a
~whole passage, which can be a different colour/pattern from
~the text (as here). Or, the under/overline/strike through can be
~character by character. Or, a combination of both.
Multiple diacritics
This sample shows the letter &ldquo;O&rdquo; with various
~combinations of diacritics built around it. Some of these are
~rather odd, but they put ucode.library to the test.
Decomposing
ucode.library &ldquo;decomposes&rdquo; letters whose Unicodes have
~a built-in diacritic, e.g. 00C0 = 0041 + 0300. This gives
~better-looking but less compact results, especially for
~small glyph sizes or where resizing has taken place. Line 1
~has decomposing suppressed, while line 2 is decomposed.
Forced under/overlines (&ldquo;rulings&rdquo;), strike throughs
Unlike &ldquo;Individual under/overlines&rdquo;,  this sample
~forces entire lines to be under/overlined, etc.
~This is what the Unicode book calls a &ldquo;higher
~protocol&rdquo;, as Unicode itself only provides for
~rulings character by character. So the Unicodes do not
~contain the rulings; rather they are inserted as tags to
~TLUformat calls.
Small capitals, old-style numerals
Like &ldquo;Forced under/overlines&rdquo;, small caps are a higher
~protocol than Unicode. Small capitals are needed to
~implement CSS2, and old-style numerals look better in text.
~I shoe-horned their glyphs into glyphless Unicode positions.
~They are implemented as tags to TLUpreview calls.
##60
Emboldening and Tilting (Italic)
ucode.library can recognise a limited set of embedded CTRL codes or
~HTML tags (e.g. &lt;i> &lt;/i>), if they do NOT have
~attributes. These can be done algorithmically (as here),
~or using alternate fonts supplied by the caller.
Monospacing
You can direct TLUpreview to monospace the characters. If a
~character is too wide for the specified monospace,
~it will be trimmed. It is of course of course better to use a
~font specifically designed to be monospaced.
Justification, ASCII
The first line is centred. Subsequent lines are full justified.
~Justification can also be left or right. Unlike previous
~samples, which had input in UTF16 format, this sample
~has input in ASCII format. ucode.library does justification
~when a program calls TLUformat.
Tabbing
The Unicode standard says it &ldquo;recognises&rdquo; the TAB
~character 0009, but gives no specifics. ucode.libeary makes
~a default set of tab positions, and the caller can override
~these if required. LTR strings count tabs from the left, and
~RTL from the right.
Jam1
ucode.library can overlay a background picture jam1 style
~if required. This example draws some stripes as background,
~and then calls ucode.library to overlay it with text.
##70
Kerning   ** not yet implemented **
When kerning is implemented, there will be a tag to request
~kerning when TLUformat is called.
Dingbats, etc.
Unicode has all kinds of wierd and wonderful characters.
~Here are some of them.
Unicode bidi
Here is the same set of Unicodes 3 times. The first line has
~bidi suppressed by LRO...PDF; the second has normal bidi; the
~third has "AB...CD" embedded by LRE...PDF which causes the AB...CD
~to appear in the right order. Note also
~mirroring of punctuation.
Soft hyphens
This text contains some soft hyphens. Note also the
~HTML-style tags, which ucode.library can do,
~provided they do not have attributes. In order to see
~how the soft hyphens work, you may need to adjust the
~window width to cause the words to be broken.
Font grabbing - Ruby.font must be in FONTS:
In this example, I have grab an Amiga font into 0021-007E.
~Ruby.font must be in FONTS:, or else this Sample will not
~work. Note that all characters composed from a grabbed font
~also use the grabbed glyph. The font gets grabbed when TLUset
~is called.
##80
Manual input
Ucode made your input into a UTF16 string. Any illegal characters
~were made into 0s.
~Finally, Ucode appended a null word delimiter. If you should
~prefer to input in ASCII (with &amp;...; as per HTML), then put
~a ! at the start of your input, e.g.
~    !&amp;ldquo;Hello,&nbsp;world&amp;rdquo;
Manual Input of a Unicode string...
You are required to input 1 or more 4-digit hex numbers,
~optionally separated by spaces.

The numbers may contain the characters 0-9 or a-f or A-F. Any
~invalid characters you specify will be replaced by 0s.

You can interpolate spaces between numbers for readability.
~Do not include zero words (i.e. 0000) in your input.
~e.g. the Unicode for the string "abc" is "0061 0062 0063".

Alternately, you can put a &lsquo;!&rsquo; as the first
~character, and then input in ASCII format, with &amp;...;
~characters, and the tags that ucode.library supports.
##90

e.g.  !Hello, &lt;i>world&lt;/i>&lt;br>Ciao,
~&lt;b>&amp;kappa;&amp;omicron;&amp;sigma;
~&amp;mu;&amp;omicron;&amp;sigmaf;</b>

Now type your input:
Error: TLUpreview / TLUformat failed
Out of memory / required glyph files unavailable
(Click to acknowledge)
View Sample
View UTF16/ASCII
Menu
##100
Here is the UTF16/ASCII for this sample string
(Click when finished viewing)
Error: TLUmake failed - out of memory
