DIRECTORY Ascii, Char, Rope, SymTab, ImagerXCMap; ImagerXCCharMapImpl: CEDAR PROGRAM IMPORTS Char, Rope, SymTab EXPORTS ImagerXCMap ~ BEGIN OPEN ImagerXCMap; asciiExceptions: PartialMap ฌ LIST [ -- irregular ASCII characters XC['$, CS0, 244B], -- 044B: $ is mapped to dollar, not ASCII currency sign XC['\047, CS0, 271B], -- 047B: ' is mapped to right quote, not ASCII apostrophy XC['^, CS0, 255B], -- 136B: ญ is mapped to up arrow, not ASCII spacing circumflex XC['_, CS0, 254B], -- 137B: ฌ is mapped to left arrow, not ASCII underscore XC['\140, CS0, 251B] -- 140B: ` is mapped to left quote, not ASCII spacing grave accent ]; hyphens: PartialMap ฌ LIST [ XC['\023, GTS1, 045B], -- 023B: Em dash XC['\026, GTS1, 044B], -- 026B: En dash XC['\030, GTS1, 046B] -- 030B: Figure dash (OldDash for TEditFormatImpl) ]; tiogaExtras: PartialMap ฌ LIST [ -- special for Tioga10 XC[', GTS1, 064B], -- 001B: Start of field (NOT IN Classic/Modern) XC[', GTS1, 065B], -- 002B: End of field (NOT IN Classic/Modern) XC[', CS0, 260B], -- 004B: Degree XC[' , CS0, 301B], -- 005B: Grave accent, non-spacing XC[' , CS0, 302B], -- 013B: Acute accent, non-spacing XC[', ALC, 050B], -- 017B: Angstrom (use A circle accented letter) XC[', CS0, 261B], -- 020B: PlusOrMinus XC[', GR, 156B], -- 024B: lambda XC[', GR, 157B], -- 025B: mu (in fact micron, but absent from classic/modern) XC[', GR, 135B], -- 026B: Omega XC[', GTS1, 045B], -- 030B: Em dash (xOldDash for TEditFormatImpl) XC['€, ALC, 047B], -- 200B: A trema XC[', ALC, 124B], -- 201B: O trema XC[' , ALC, 247B], -- 240B: a trema XC['ก, ALC, 324B], -- 241B: o trema XC['ฃ, ALC, 345B], -- 243B: u trema XC['ค, ALC, 255B], -- 244B: c cedilla XC['ฉ, CS0, 251B], -- 251B: Left quote XC['ช, CS0, 252B], -- 252B: Left double quote XC['ซ, CS0, 253B], -- 253B: Left brackets XC['ฌ, CS0, 254B], -- 254B: Left arrow (variant graphics) XC['ญ, CS0, 255B], -- 255B: Up arrow (variant graphics) XC['ฎ, CS0, 256B], -- 256B: Right arrow XC['ฏ, CS0, 257B], -- 257B: Down arrow XC['ต, JIS1, 172B], -- 265B: Star XC['ท, GTS1, 146B], -- 267B: Bullet XC['น, CS0, 271B], -- 271B: Right quote XC['บ, CS0, 272B], -- 272B: Right double quote XC['ป, CS0, 273B], -- 273B: Right brackets XC['ม , CS0, 301B], -- 301B: Grave accent, non-spacing (variant graphics) XC['ย , CS0, 302B], -- 302B: Acute accent, non-spacing (variant graphics) XC['ร , CS0, 303B], -- 303B: Circumflex accent, non-spacing (variant graphics) XC['ำ, CS0, 323B] -- 323B: Copyright ]; apl: PartialMap ฌ LIST [ -- TBD ]; amTeX: PartialMap ฌ LIST [ XC[', CS0, 257B], -- 001B: Down arrow XC[', GR, 141B], -- 002B: alpha XC[', GR, 142B], -- 003B: beta XC[', GTS1, 266B], -- 004B: Logical And XC[', GTS1, 152B], -- 005B: Logical Not XC[', GTS1, 112B], -- 006B: Member of XC[', GR, 163B], -- 007B: pi XC[', GR, 156B], -- 010B: lambda XC[' , CS0, 255B], -- 013B: Up arrow XC[' , CS0, 261B], -- 014B: PlusOrMinus XC[', JIS1, 147B], -- 016B: Infinity XC[', GTS1, 272B], -- 017B: Partial derivative XC[', GTS1, 133B], -- 020B: Contained in XC[', GTS1, 132B], -- 021B: Contains XC[', GTS1, 126B], -- 022B: Intersection XC[', GTS1, 127B], -- 023B: Union XC[', GTS1, 265B], -- 024B: For all XC[', GTS1, 264B], -- 025B: There exists XC[', GTS1, 144B], -- 026B: Absolute product XC[', GTS1, 121B], -- 027B: Twin arrows XC[', CS0, 254B], -- 030B: Left arrow XC[', CS0, 256B], -- 031B: Right arrow XC[', JIS1, 142B], -- 032B: Different XC[', JIS1, 176B], -- 033B: Diamond (not in Classic/Modern) XC[', JIS1, 145B], -- 034B: Less than or equal XC[', JIS1, 146B], -- 035B: Greater than or equal XC[', GTS1, 162B], -- 036B: Identical XC[', GTS1, 267B], -- 037B: Logical Or XC['$, CS0, 244B], -- 044B: $ is mapped to dollar, not ASCII currency sign XC[', GTS1, 165B], -- 177B: Integral XC['ค, CS0, 244B], -- 244B: Dollar (variant graphics) XC['ฉ, CS0, 251B], -- 251B: Left quote (variant graphics) XC['ช, CS0, 252B], -- 252B: Left double quote (variant graphics) XC['ซ, CS0, 253B], -- 253B: Left brackets (variant graphics) XC['ฌ, CS0, 254B], -- 254B: Left arrow (variant graphics) XC['ญ, CS0, 255B], -- 255B: Up arrow (variant graphics) XC['ฎ, CS0, 256B], -- 256B: Right arrow (variant graphics) XC['ฏ, CS0, 257B], -- 257B: Down arrow (variant graphics) XC['น, CS0, 271B], -- 271B: Right quote (variant graphics) XC['บ, CS0, 272B], -- 272B: Right double quote (variant graphics) XC['ป, CS0, 273B], -- 273B: Right brackets (variant graphics) XC['ำ, CS0, 323B] -- 323B: Copyright (variant graphics) ]; cream: PartialMap ฌ LIST [ XC[', JIS1, 145B], -- 001B: Less than or equal XC[', GTS1, 162B], -- 006B: Identical XC[', GTS1, 162B], -- 007B: Degree (approximation only...) XC[', JIS1, 142B], -- 016B: Different XC[', GTS2, 252B], -- 021B: Double up arrow (not in Classic/Modern) XC[', JIS1, 146B], -- 022B: Greater than or equal XC[', ELA, 303B], -- 025B: Overline (not in Classic/Modern) XC[', GTS1, 045B], -- 030B: Em dash (xOldDash for TEditFormatImpl) XC[', GTS1, 117B], -- 033B: Implies XC[', JIS2, 042B], -- 035B: Square ]; cyrillic: PartialMap ฌ LIST [ -- TBD ]; eightBitExtras: PartialMap ฌ LIST [ -- XC[', CS0, 317B], -- 001B: Hacheck, non-spacing instead of spacing XC[', CS0, 277B], -- 002B: Spanish question mark XC[', ALC, 255B], -- 003B: c cedilla XC[', CS0, 310B], -- 004B: Trema, non-spacing instead of spacing XC[', CS0, 301B], -- 005B: grave accent, non-spacing instead of spacing XC[', LIG, 041B], -- 006B: ff ligature XC[', CS0, 251B], -- 007B: Left quote (alternate) XC[', CS0, 241B], -- 010B: Inverted bang XC[' , CS0, 302B], -- 013B: acute accent, non-spacing instead of spacing XC[', CS0, 305B], -- 016B: long accent, non-spacing instead of spacing XC[', CS0, 304B], -- 020B: tilda accent, non-spacing instead of spacing XC[', LIG, 042B], -- 021B: ffi ligature XC[', LIG, 043B], -- 022B: ffl ligature XC[', LIG, 044B], -- 024B: fi ligature XC[', LIG, 045B], -- 025B: fl ligature XC[', CS0, 306B], -- 027B: Breve, non-spacing instead of spacing XC[', ELA, 326B], -- 035B: Dot below accent, non-spacing instead of spacing (??) XC[', CS0, 304B], -- 036B: Tilda, non-spacing instead of spacing XC[', CS0, 312B], -- 037B: Ring, non-spacing instead of spacing XC['€, ALC, 047B], -- 200B: A trema XC[', ALC, 124B], -- 201B: O trema XC['‚, ALC, 050B], -- 202B: A with ring accent XC[', LIG, 041B], -- 220B: ff ligature XC['‘, LIG, 042B], -- 221B: ffi ligature XC['’, LIG, 043B], -- 222B: ffl ligature XC['“, LIG, 044B], -- 223B: fi ligature XC['”, LIG, 045B], -- 224B: fl ligature XC['›, GTS1, 044B], -- 233B: En dash XC['œ, GTS1, 045B], -- 234B: Em dash XC[', GTS1, 046B], -- 235B: Figure dash XC['ž, ELA, 326B], -- 235B: UnderDot accent, non-spacing instead of spacing XC[' , ALC, 247B], -- 240B: a trema XC['ก, ALC, 324B], -- 241B: o trema XC['ข, ALC, 250B], -- 242B: a with ring accent XC['ฃ, ALC, 345B], -- 243B: u trema XC['ค, ALC, 255B], -- 244B: c cedilla XC['จ, CS0, 310B], -- 250B: Trema, non-spacing instead of spacing XC['ฉ, CS0, 312B], -- 251B: Ring accent, non-spacing instead of spacing XC['ช, CS0, 301B], -- 252B: Grave accent, non-spacing instead of spacing XC['ซ, CS0, 302B], -- 253B: Acute accent, non-spacing instead of spacing XC['ฌ, CS0, 303B], -- 254B: Circumflex accent, non-spacing instead of spacing XC['ญ, CS0, 304B], -- 255B: Tilda, non-spacing instead of spacing XC['ฎ, CS0, 306B], -- 256B: Breve accent, non-spacing instead of spacing XC['ฏ, CS0, 305B], -- 257B: Macron accent, non-spacing instead of spacing XC['ฐ, CS0, 242B], -- 261B: Cent XC['ฑ, CS0, 243B], -- 262B: Pound XC['ต, JIS1, 172B], -- 265B: Star XC['ถ, CS0, 247B], -- 266B: Section XC['ท, GTS1, 146B], -- 267B: Bullet XC['ธ, GTS1, 060B], -- 270B: Dag XC['น, GTS1, 061B], -- 271B: Ddag XC['บ, CS0, 266B], -- 272B: Paragraph XC['ผ, CS0, 261B], -- 274B: PlusOrMinus XC['ฝ, CS0, 241B], -- 275B: Inverted bang XC['พ, CS0, 277B], -- 276B: Inverted question mark XC['ฟ, CS0, 137B], -- 277B: Underscore XC['฿, GTS1, 43B], -- 337B: Discretionary hyphen (??) XC['่, CS0, 306B], -- 350B: Breve, non-spacing instead of spacing XC['้, ELA, 326B] -- 351B: UnderDot accent, non-spacing instead of spacing ]; gacha: PartialMap ฌ LIST [ XC['\047, CS0, 047B], -- 047B: apostrophy remains apostrophy XC['\140, CS0, 140B] -- 140B: spacing grave accent remains spacing grave accent ]; hebrew: PartialMap ฌ LIST [ -- TBD ]; helvetica: PartialMap ฌ LIST [ -- XC[', CS0, 277B], -- 002B: Spanish question mark XC[', ALC, 255B], -- 003B: c cedilla XC[', LIG, 041B], -- 006B: ff ligature XC[', CS0, 251B], -- 007B: Left quote (alternate) XC[', CS0, 241B], -- 010B: Inverted bang XC[', LIG, 042B], -- 021B: ffi ligature XC[', LIG, 043B], -- 022B: ffl ligature XC[', LIG, 044B], -- 024B: fi ligature XC[', LIG, 045B], -- 025B: fl ligature XC['\047, LIG, 047B] -- 047B: ' is mapped ]; hippo: PartialMap ฌ LIST [ -- For greek fonts XC[', CS0, 251B], -- 007B: Left quote (alternate) XC['A, GR, 101B], XC['a, GR, 141B], -- Alpha, alpha XC['B, GR, 102B], XC['b, GR, 142B], -- Beta, beta (word middle missing) XC['G, GR, 104B], XC['g, GR, 144B], -- Gamma, gamma XC['D, GR, 105B], XC['d, GR, 145B], -- Delta, delta XC['E, GR, 106B], XC['e, GR, 146B], -- Epsilon, epsilon XC['Z, GR, 111B], XC['z, GR, 151B], -- Zeta, zeta XC['H, GR, 112B], XC['h, GR, 152B], -- Eta, eta XC['Q, GR, 113B], XC['q, GR, 153B], -- Theta, theta XC['I, GR, 114B], XC['i, GR, 154B], -- Iota, iota XC['K, GR, 115B], XC['k, GR, 155B], -- Kappa, kappa XC['L, GR, 116B], XC['l, GR, 156B], -- Lambda, lambda XC['M, GR, 117B], XC['m, GR, 157B], -- Mu, mu XC['N, GR, 120B], XC['n, GR, 160B], -- Nu, nu XC['C, GR, 121B], XC['c, GR, 161B], -- Xi, xi XC['O, GR, 122B], XC['o, GR, 162B], -- Omicron, omicron XC['P, GR, 123B], XC['p, GR, 163B], -- Pi pi XC['R, GR, 125B], XC['r, GR, 165B], -- Rho, rho XC['S, GR, 126B], XC['s, GR, 166B], XC['j, GR, 167B], -- Sigma, sigma, sigma end XC['T, GR, 130B], XC['t, GR, 170B], -- Tau, tau XC['U, GR, 131B], XC['u, GR, 171B], -- Upsilon, upsilon XC['F, GR, 132B], XC['f, GR, 172B], -- Phi, phi XC['X, GR, 133B], XC['x, GR, 173B], -- Chi, chi XC['Y, GR, 134B], XC['y, GR, 174B], -- Psi, psi XC['W, GR, 135B], XC['w, GR, 175B] -- Omega, omega ]; math: PartialMap ฌ LIST [ -- complete mapping for Math family XC[', GTS1, 173B], -- 001B: Product sign XC[', GTS1, 062B], -- 002B: Bra XC[', GTS1, 063B], -- 003B: Ket XC[', CS0, 243B], -- 005B: Pound sign XC[', GTS1, 165B], -- 005B: Integral XC[', GTS1, 166B], -- 006B: Path integral XC[' , CS0, 266B], -- 013B: Paragraph sign XC[', GTS1, 172B], -- 023B: Sum sign XC[', GTS1, 157B], -- 026B: Because sign XC[' , LIG, 376B], -- 040B: Visible space (not in Classic/Modern) XC['!, GTS1, 060B], -- 041B: Dag XC['", CS0, 260B], -- 042B: Degree sign XC['#, JIS1, 147B], -- 043B: Infinity sign XC['$, CS0, 242B], -- 044B: Cent sign XC['%, CS0, 270B], -- 045B: Divide sign XC['&, GTS1, 266B], -- 046B: Logical AND XC['', GTS1, 163B], -- 047B: Define symbol XC['(, CS0, 047B], -- 050B: Prime symbol, replace with regular ASCII quote (no equivalent) ?? XC['), GTS1, 174B], -- 051B: Radical symbol XC['*, CS0, 047B], -- 052B: Small dot, replace with regular ASCII quote (no equivalent) ?? XC['+, CS0, 261B], -- 053B: PlusOrMinus symbol XC[',, GTS1, 114B], -- 054B: Such that symbol XC['-, GTS1, 175B], -- 055B: MinusOrPlus symbol XC['., JIS1, 150B], -- 056B: Therefore symbol XC['/, GTS1, 145B], -- 057B: Absolute division symbol XC['0, JIS1, 173B], -- 060B: Circle (not in Classic/Modern) XC['1, JIS2, 042B], -- 061B: Square XC['2, GR, 105B], -- 062B: Triangle (use greek Delta, normal not in Classic/Modern) XC['3, JIS1, 176B], -- 063B:Diamond (not in Classic/Modern) XC['4, GTS1, 142B], -- 064B: Absolute sum symbol XC['5, GTS1, 143B], -- 065B: Absolute difference symbol XC['6, GTS1, 144B], -- 066B: Absolute product symbol XC['7, GTS1, 154B], -- 067B: Angle symbol XC['8, JIS1, 172B], -- 070B: Star XC['9, CS0, 047B], -- 071B: Medium dot, replace with regular ASCII quote (no equivalent) ?? XC[':, CS0, 247B], -- 072B: Section symbol XC[';, GTS2, 273B], -- 073B: Black filler (not in Classic/Modern) XC['<, JIS1, 145B], -- 074B: Less than or equal to symbol XC['=, JIS1, 142B], -- 075B: Different symbol XC['>, JIS1, 146B], -- 076B: Greater than or equal to symbol XC['?, CS0, 277B], -- 077B: Reverse question mark XC['@, GTS1, 100B], -- 100B: Care of symbol XC['A, GTS1, 265B], -- 101B: Forall symbol XC['B, GTS1, 112B], -- 102B: Member of symbol XC['C, GTS1, 254B], -- 103B: Complex set symbol XC['D, GTS1, 271B], -- 104B: Nabla symbol XC['E, GTS1, 264B], -- 105B: There exists symbol XC['F, GTS1, 061B], -- 106B: DDag symbol XC['G, GTS1, 133B], -- 107B: Contained in symbol XC['H, GTS1, 137B], -- 110B: Not contained in symbol XC['I, GTS1, 131B], -- 111B: Contained in or equal to symbol XC['J, GTS1, 132B], -- 112B: Contains symbol XC['K, GTS1, 136B], -- 113B: Not contains symbol XC['L, GTS1, 130B], -- 114B: Contains or equal symbol XC['M, LIG, 276B], -- 115B: Carriage Return symbol (not in Classic/Modern) XC['N, GTS1, 113B], -- 116B: Not member symbol XC['O, GTS1, 141B], -- 117B: Empty set symbol XC['P, GTS1, 161B], -- 120B: Proportional symbol XC['Q, GTS1, 121B], -- 121B: Twin arrows XC['R, GTS1, 256B], -- 122B: Real set symbol XC['S, GTS1, 171B], -- 123B: Asympt. equal symbol XC['T, GTS1, 160B], -- 124B: Perpendicular symbol XC['U, GTS1, 127B], -- 125B: Union symbol XC['V, GTS1, 267B], -- 126B: Logical OR symbol XC['W, GTS1, 162B], -- 127B: Identical symbol XC['X, CS0, 264B], -- 130B: Times symbol XC['Y, LIG, 272B], -- 131B: Line Feed symbol (not in Classic/Modern) XC['Z, GTS1, 270B], -- 132B: QED symbol XC['[, CS0, 074B], -- 133B: Less than symbol (no curly version in XC1-2-2) XC['\\, CS0, 057B], -- 134B: Over symbol (no thick version in XC1-2-2) XC['], CS0, 076B], -- 135B: Greater than symbol (no curly version in XC1-2-2) XC['^, CS0, 257B], -- 136B: Down arrow (not in Classic/Modern) XC['_, CS0, 256B], -- 137B: Right arrow (not in Classic/Modern) XC['a, GTS1, 247B], -- 141B: Aleph symbol XC['b, GTS1, 123B], -- 142B: Leads to symbol XC['c, CS0, 323B], -- 143B: Copyright symbol XC['d, GTS1, 272B], -- 144B: Partial derivative symbol XC['e, GTS1, 167B], -- 145B: Approx. equal symbol XC['f, GTS1, 122B], -- 146B: Bidirectional arrow XC['g, GTS1, 117B], -- 147B: Implies arrow XC['h, GTS1, 150B], -- 150B: Planck constant XC['i, GTS1, 260B], -- 151B: Left ceiling XC['j, GTS1, 261B], -- 152B: Right ceiling XC['k, GTS1, 262B], -- 153B: Left floor XC['l, GTS1, 263B], -- 154B: Right floor XC['m, GTS1, 110B], -- 155B: Parallel symbol XC['n, GTS1, 152B], -- 156B: Logical not symbol XC['o, GTS1, 147B], -- 157B: Little circle XC['p, GTS1, 066B], -- 160B: Left perp. symbol XC['q, GTS1, 070B], -- 161B: Left double perp. symbol XC['r, CS0, 322B], -- 162B: Registered symbol XC['s, GTS1, 076B], -- 163B: Right up arrow XC['t, GTS1, 074B], -- 164B: Left up arrow XC['u, GTS1, 077B], -- 165B: Left down arrow XC['v, GTS1, 075B], -- 166B: Right down arrow XC['w, GTS1, 102B], -- 167B: Much smaller symbol XC['x, GTS1, 103B], -- 170B: Much larger symbol XC['y, GTS1, 126B], -- 171B: Intersection symbol XC['z, GTS1, 067B], -- 172B: Right perp. symbol XC['{, CS0, 274B], -- 173B: 1/4 fraction XC['|, CS0, 275B], -- 174B: 1/2 fraction XC['}, CS0, 276B], -- 175B: 3/4 fraction XC['~, GTS1, 120B] -- 176B: Reciprocal arrows ]; oldEnglish: PartialMap ฌ LIST [ -- complete mapping for Math family XC[', CS0, 251B] -- 007B: Left quote (alternate) ]; sail: PartialMap ฌ LIST [ XC[', CS0, 257B], -- 001B: Down arrow XC[', GR, 141B], -- 002B: alpha XC[', GR, 142B], -- 003B: beta XC[', GTS1, 266B], -- 004B: Logical And XC[', GTS1, 152B], -- 005B: Logical Not XC[', GTS1, 112B], -- 006B: Member of XC[', GR, 163B], -- 007B: pi XC[', GR, 156B], -- 010B: lambda XC[', JIS1, 147B], -- 016B: Infinity XC[', GTS1, 272B], -- 017B: Partial derivative XC[', GTS1, 133B], -- 020B: Contained in XC[', GTS1, 132B], -- 021B: Contains XC[', GTS1, 126B], -- 022B: Intersection XC[', GTS1, 127B], -- 023B: Union XC[', GTS1, 265B], -- 024B: For all XC[', GTS1, 264B], -- 025B: There exists XC[', GTS1, 144B], -- 026B: Absolute product XC[', GTS1, 122B], -- 027B: Left-Right arrow XC[', CS0, 137B], -- 030B: Underscore XC[', CS0, 256B], -- 031B: Right arrow XC[', CS0, 176B], -- 032B: Tilda symbol XC[', JIS1, 142B], -- 033B: Different XC[', JIS1, 145B], -- 034B: Less than or equal XC[', JIS1, 146B], -- 035B: Greater than or equal XC[', GTS1, 162B], -- 036B: Identical XC[', GTS1, 267B], -- 037B: Logical Or XC['~, CS0, 175B] -- 176B: Right brace (as 175B) ??? ]; maps: PUBLIC SymTab.Ref; cs0Map: PUBLIC Map ฌ NEW [MapRep]; -- c -> [CS0, c] starsMap: Map ฌ NEW [MapRep]; -- c-> * GetFamilyMap: PUBLIC PROC [family: Rope.ROPE] RETURNS [map: Map] ~ { map ฌ NARROW [SymTab.Fetch[maps, family].val]; IF map=NIL THEN { AddMap[family, NIL]; -- define the thing to be identity since unknown... map ฌ NARROW [SymTab.Fetch[maps, family].val]; -- in case of race condition... }; }; GetFontMap: PUBLIC PROC [fontName: Rope.ROPE] RETURNS [map: Map] ~ { map ฌ NARROW [SymTab.Fetch[maps, fontName].val]; IF map=NIL THEN { -- map not registered yet family: Rope.ROPE ฌ ClipAfter[fontName, "/>"]; SELECT TRUE FROM IsSuffix[fontName, "-mrr"] => family ฌ StripSuffix[family, "-mrr"]; IsSuffix[fontName, "-mir"] => family ฌ StripSuffix[family, "-mir"]; IsSuffix[fontName, "-brr"] => family ฌ StripSuffix[family, "-brr"]; IsSuffix[fontName, "-bir"] => family ฌ StripSuffix[family, "-bir"]; IsSuffix[fontName, "I"] => family ฌ StripScale[family, "I"]; IsSuffix[fontName, "B"] => family ฌ StripScale[family, "B"]; IsSuffix[fontName, "IB"] => family ฌ StripScale[family, "IB"]; ENDCASE => family ฌ StripScale[family, ""]; map ฌ GetFamilyMap[family]; [] ฌ SymTab.Store[maps, fontName, map]; -- for future reference... }; }; ControlCharacterBug: PUBLIC SIGNAL [code: CHAR] ~ CODE; controlChars: LIST OF CHAR ฌ LIST [Ascii.CR, Ascii.TAB]; MakeMap: PUBLIC PROC [entriesList: PartialMaps, default: Map ฌ cs0Map] RETURNS [map: Map] ~ { map ฌ NEW [MapRep]; FOR c: CHAR IN CHAR DO map[c] ฌ default[c] ENDLOOP; FOR lists: PartialMaps ฌ entriesList, lists.rest UNTIL lists=NIL DO FOR entries: PartialMap ฌ lists.first, entries.rest UNTIL entries=NIL DO entry: XC = entries.first; FOR lc: LIST OF CHAR ฌ controlChars, lc.rest UNTIL lc=NIL DO IF entry.c=lc.first THEN SIGNAL ControlCharacterBug[entry.c]; ENDLOOP; map[entry.c] ฌ Char.Make[set: ORD[entry.set], code: entry.code]; ENDLOOP; ENDLOOP; }; AddMap: PUBLIC PROC [family: Rope.ROPE, entriesList: PartialMaps, default: Map ฌ cs0Map] ~ { map: Map ฌ MakeMap[entriesList, default]; [] ฌ SymTab.Store[maps, family, map]; }; InitMaps: PROC [] RETURNS [] ~ { maps ฌ SymTab.Create[case: FALSE]; FOR c: CHAR IN CHAR DO cs0Map[c] ฌ Char.Make[set: 0, code: ORD[c]] ENDLOOP; FOR c: CHAR IN CHAR DO starsMap[c] ฌ Char.Make[set: 0, code: ORD['*]] ENDLOOP; FOR lc: LIST OF CHAR ฌ controlChars, lc.rest UNTIL lc=NIL DO -- Aargh !!! starsMap[lc.first] ฌ Char.Make[set: 0, code: ORD[lc.first]]; ENDLOOP; AddMap["AMTeX", LIST[amTeX]]; AddMap["APL", LIST[apl]]; AddMap["Arrows", NIL]; -- No possible mapping AddMap["Asterisk", NIL, starsMap]; -- Funny case... AddMap["Chess", NIL]; -- No possible mapping AddMap["Classic", LIST[asciiExceptions]]; AddMap["Cream", LIST[asciiExceptions, cream]]; AddMap["Cyrillic", LIST[cyrillic]]; AddMap["EightBitTimesRoman", LIST[asciiExceptions, hyphens, eightBitExtras]]; AddMap["Gacha", LIST[asciiExceptions, gacha]]; AddMap["Hebrew", LIST[hebrew]]; AddMap["Helvetica", LIST[hyphens, helvetica]]; AddMap["Hippo", LIST[asciiExceptions, hyphens, hippo]]; AddMap["Logo", NIL]; -- TBD AddMap["Math", LIST[math]]; AddMap["OldEnglish", LIST[asciiExceptions, hyphens, oldEnglish]]; AddMap["ReverseGacha", LIST[asciiExceptions, gacha]]; AddMap["Sail", LIST[asciiExceptions, sail]]; AddMap["Template", NIL]; -- No possible mapping AddMap["TimesRoman", LIST[hyphens, helvetica]]; AddMap["Tioga", LIST[asciiExceptions, tiogaExtras]]; AddMap["VoicePlay", NIL]; -- No possible mapping AddMap["VoiceProfile", NIL]; -- No possible mapping AddMap["XeroxLogotypes", NIL]; -- TBD }; ClipAfter: PROC [r: Rope.ROPE, clip: Rope.ROPE] RETURNS [after: Rope.ROPE] ~ { clipPos: INT; len: INT = Rope.Length[r]; FOR pos: INT ฌ -1, Rope.SkipTo[r, clipPos, clip] UNTIL pos=len DO clipPos ฌ pos+1; ENDLOOP; after ฌ Rope.Substr[r, clipPos]; }; IsSuffix: PROC [r: Rope.ROPE, suffix: Rope.ROPE, case: BOOL ฌ TRUE] RETURNS [BOOL] ~ { pos: INT = Rope.FindBackward[r, suffix, 0, case]; IF pos<0 THEN RETURN [FALSE]; RETURN [pos+Rope.Length[suffix]=Rope.Length[r]]; }; StripSuffix: PROC [r: Rope.ROPE, suffix: Rope.ROPE] RETURNS [prefix: Rope.ROPE] ~ { prefix ฌ Rope.Substr[r, 0, Rope.Length[r]-Rope.Length[suffix]]; }; StripScale: PROC [r: Rope.ROPE, suffix: Rope.ROPE] RETURNS [prefix: Rope.ROPE] ~ { prefixLen: INT ฌ Rope.Length[r]-Rope.Length[suffix]; FOR i: INT DECREASING IN [0 .. prefixLen) DO IF Rope.Fetch[prefix, i] IN ['0 .. '9] THEN prefixLen ฌ i ELSE EXIT; ENDLOOP; prefix ฌ Rope.Substr[r, 0, prefixLen]; }; InitMaps[]; END. ะ ImagerXCCharMapImpl.mesa Copyright ำ 1987, 1992 by Xerox Corporation. All rights reserved. Jean-Marc Frailong February 10, 1988 11:22:45 am PST Defines mappings from standard (???) Tioga character codes to XC1-2-2 codes The idea is to provide mappings in such a way that, in a style, one may say: (GreekFont) "Greek font" { IF the device (xc) .eq THEN {"Classic" family "Hippo" XCMap} ELSE {"Hippo" family} } PrintRule which means that when XC device is selected (and also XC fonts...) then the characters in that font are to be remapped according to the Hippo font -> XC1-2-2 mapping Willie-s, April 6, 1992 12:56 pm PDT Tioga->XC mapping components Maps differently a few ASCII characters that do not behave normally with all Tioga fonts XC['-, CS0, 055B], -- Minus (or use one of the other dashes? ) Defines the various standard dash/hyphens (in a single place to facilitate changes...) Extension of ASCII for Tioga family Overlay asciiExceptions, tiogaExtras Maps [001B .. 017B], [200B .. 376B] with plenty of holes XC[', CS0, 000B], -- 003B: not in XC1-2-2 XC[', CS0, 000B], -- 007B: not in XC1-2-2 XC[', CS0, 000B], -- 032B: not in XC1-2-2 All non-identity characters in APL font Do NOT merge with any other map ... All non-identity characters in AMTeX fonts Do NOT merge with any other map ... XC['\000, CS0, 000B], -- 000B: Little square - Cancelled as control code (NUL) XC['\011, CS0, 257B], -- 011B: lambda - Cancelled as control code (TAB) XC['\012, GR, 145B], -- 012B: delta - Cancelled as control code (LF) XC['\015, GTS1, 142B], -- 015B: Absolute Sum - Cancelled as control code (CR) Adjuncts to asciiExceptions for Cream font Maps [001B .. 037B] only XC[', CS0, 000B], -- 003B: not in XC1-2-2 XC[', CS0, 000B], -- 005B: not in XC1-2-2 XC[', CS0, 000B], -- 017B: not in XC1-2-2 XC[', CS0, 000B], -- 023B: not in XC1-2-2 XC[', CS0, 000B], -- 024B: not in XC1-2-2 XC[', CS0, 000B], -- 026B: not in XC1-2-2 XC[', CS0, 000B], -- 027B: not in XC1-2-2 XC[', CS0, 000B], -- 031B: not in XC1-2-2 XC[', CS0, 000B] -- 036B: not in XC1-2-2 Full map for Cyrillic family Adjuncts to asciiExceptions for EightBitTimesRoman font Maps [001B .. 017B], [200B..376B] with plenty of holes XC['\023, GTS1, 045B], -- 023B: Em dash - Defined in hyphens XC['\026, GTS1, 044B], -- 026B: En dash - Defined in hyphens XC['\030, GTS1, 046B], -- 030B: Figure dash (OldDash) - Defined in hyphens Remove apostrophy and left quote hacks for gacha (fixed-pitch terminal emulation) Full map for Hebrew family Full map for Helvetica/TimesRoman font (XC Helvetica/TimesRoman are not strictly kosher for codes in asciiExceptions) Maps [001B .. 017B] with plenty of holes XC['\023, GTS1, 045B], -- 023B: Em dash - Defined in hyphens XC['\026, GTS1, 044B], -- 026B: En dash - Defined in hyphens XC['\030, GTS1, 046B], -- 030B: Figure dash (OldDash) - Defined in hyphens Greek alphabet, on top as asciiExceptions & hyphens Stand alone XC[', CS0, 000B], -- 017B: No equivalent symbol in XC1-2-2 Ascii extensions for SAIL XC[' , CS0, 000B], -- 013B: not in XC1-2-2 XC[' , CS0, 000B], -- 014B: not in XC1-2-2 Standard maps Retrieve the mapping for specified family. If not found, return identity map to set 0 Retrieve the mapping for a specific map. All fonts for a family are guaranteed to have the same Map pointer (so that modifications to one also modify the other). Family is found as -brr (press style) or 10B Everything up to / or > is ignored first... These are the only control codes known by TEditFormat. Create a Map from a list of overlaid PartialMap. Last entry specifying a character wins. Unassigned characters use the default mapping. The map is added to the table. Create a Map from a list of overlaid PartialMap. Last entry specifying a character wins. Unassigned characters use the default mapping. The map is added to the table. Create all the maps that go from Tioga fonts to XC1-2-2 codes Utilities Remove from r everything up to the last occurence of a char from clip Returns TRUE iff suffix matches the end of r ส5ด–(cedarcode) style•NewlineDelimiter ™codešœ™Kšœ ฯeœ7™BK™4K™K™KK™Lšœฯb œ™šœR™RKšœ ™ ——K™ฅK™$K™—šฯk ˜ K˜'—K˜KšะblœŸœŸ˜"KšŸœ˜KšŸœ ˜KšœŸ œ Ÿ˜headšœŸœ™šœŸœฯc˜BKšœŸœ<™XKšŸœŸœ ก7˜JKšŸœŸœ ก9˜OKšŸœŸœ ก+™>KšŸœŸœ ก œก4˜QKšŸœŸœ ก œก.˜KKšŸœŸœกB˜WK˜K˜—šœŸœ˜K™VKšŸœŸœ ก˜'KšŸœŸœ ก˜'KšŸœŸœก2˜HK˜K˜—šœŸœก˜7Kšœ Ÿœ™#Kšœ$™$K™8KšŸœŸœ ก/˜CKšŸœŸœ ก-˜AKšŸœŸœ ก™*KšŸœŸœ ก˜"KšŸœŸœ ก"˜6KšŸœŸœ ก™*KšŸœŸœ ก"˜6KšŸœŸœ ก0˜CKšŸœŸœ ก˜'KšŸœŸœ ก˜!KšŸœŸœ ก<˜NKšŸœŸœ ก˜ KšŸœŸœ ก/˜CKšŸœŸœ ก™*KšŸœŸœ ก˜#KšŸœŸœ ก˜#KšŸœŸœ ก˜#KšŸœŸœ ก˜#KšŸœŸœ ก˜#KšŸœŸœ ก˜%KšŸœŸœ ก˜&KšŸœŸœ ก˜-KšŸœŸœ ก˜)KšŸœŸœ ก&˜9KšŸœŸœ ก$˜7KšŸœŸœ ก˜'KšŸœŸœ ก˜&KšŸœŸœ ก ˜!KšŸœŸœ ก˜#KšŸœŸœ ก˜'KšŸœŸœ ก˜.KšŸœŸœ ก˜*KšŸœŸœ ก5˜IKšŸœŸœ ก5˜IKšŸœŸœ ก:˜NKšŸœŸœก˜$K˜K˜—šœŸœกะbc˜KšœŸœ™'KšœŸœ™#K˜K˜—šœŸœ˜K™*KšœŸœ™#KšŸœŸœ ก8™NK• CharPropsPostfix"AMTEX" family!šŸœŸœ ก˜&K–Postfix"AMTEX" familyšŸœŸœ กะctก˜ K–Postfix"AMTEX" familyšŸœŸœ กฃก˜K–Postfix"AMTEX" family#šŸœŸœ กฃก ˜(K–Postfix"AMTEX" family#šŸœŸœ กฃก ˜(K–Postfix"AMTEX" family!šŸœŸœ กฃก ˜&K–Postfix"AMTEX" familyšŸœŸœ กฃก˜K–Postfix"AMTEX" familyšŸœŸœ กฃก˜!KšŸœŸœ กฃก*™GKšŸœŸœ กฃก(™DK–Postfix"AMTEX" familyšŸœŸœ กฃก ˜$K–Postfix"AMTEX" family"šŸœŸœ กฃก ˜'KšŸœŸœ กฃก/™MK–Postfix"AMTEX" family šŸœŸœ กฃก ˜%K–Postfix"AMTEX" family*šŸœŸœ กฃก˜/K–Postfix"AMTEX" family$šŸœŸœ กฃก˜)K–Postfix"AMTEX" family šŸœŸœ กฃก ˜%K–Postfix"AMTEX" family$šŸœŸœ กฃก˜)K–Postfix"AMTEX" familyšŸœŸœ กฃก˜"K–Postfix"AMTEX" familyšŸœŸœ กฃก ˜$K–Postfix"AMTEX" family$šŸœŸœ กฃก˜)K–Postfix"AMTEX" family(šŸœŸœ กฃก˜-K–Postfix"AMTEX" family#šŸœŸœ กฃก ˜(K–Postfix"AMTEX" family!šŸœŸœ กฃก ˜&K–Postfix"AMTEX" family"šŸœŸœ กฃก ˜'K–Postfix"AMTEX" family!šŸœŸœ กฃก ˜&K–Postfix"AMTEX" family7š ŸœŸœ กฃก ขก˜šŸœŸœ ก0˜CK–*Postfix"EightBitTimesRoman" family,šŸœŸœ ก˜1K–*Postfix"EightBitTimesRoman" family šŸœŸœ ก˜%K–*Postfix"EightBitTimesRoman" family<šŸœŸœ ก.˜AK–*Postfix"EightBitTimesRoman" familyCšŸœŸœ ก5˜HK–*Postfix"EightBitTimesRoman" family"šŸœŸœ ก˜'K–*Postfix"EightBitTimesRoman" family-šŸœŸœ ก˜2K–*Postfix"EightBitTimesRoman" family$šŸœŸœ ก˜)K–*Postfix"EightBitTimesRoman" familyCšŸœŸœ ก5˜HK–*Postfix"EightBitTimesRoman" familyBšŸœŸœ ก4˜GK–*Postfix"EightBitTimesRoman" familyCšŸœŸœ ก5˜HK–*Postfix"EightBitTimesRoman" family#šŸœŸœ ก˜(K–*Postfix"EightBitTimesRoman" family#šŸœŸœ ก˜(KšŸœŸœ ก%™˜QK–*Postfix"EightBitTimesRoman" family<šŸœŸœ ก.˜AK–*Postfix"EightBitTimesRoman" family;šŸœŸœ ก-˜@K–*Postfix"EightBitTimesRoman" familyšŸœŸœ ก˜#K–*Postfix"EightBitTimesRoman" familyšŸœŸœ ก˜#K–*Postfix"EightBitTimesRoman" family)šŸœŸœ ก˜.K–*Postfix"EightBitTimesRoman" family"šŸœŸœ ก˜'K–*Postfix"EightBitTimesRoman" family#šŸœŸœ ก˜(K–*Postfix"EightBitTimesRoman" family#šŸœŸœ ก˜(K–*Postfix"EightBitTimesRoman" family"šŸœŸœ ก˜'K–*Postfix"EightBitTimesRoman" family"šŸœŸœ ก˜'K–*Postfix"EightBitTimesRoman" familyšŸœŸœ ก˜$K–*Postfix"EightBitTimesRoman" familyšŸœŸœ ก˜$K–*Postfix"EightBitTimesRoman" family#šŸœŸœ ก˜(K–*Postfix"EightBitTimesRoman" familyFšŸœŸœ ก8˜KK–*Postfix"EightBitTimesRoman" familyšŸœŸœ ก˜#K–*Postfix"EightBitTimesRoman" familyšŸœŸœ ก˜#K–*Postfix"EightBitTimesRoman" family)šŸœŸœ ก˜.K–*Postfix"EightBitTimesRoman" familyšŸœŸœ ก˜#K–*Postfix"EightBitTimesRoman" family šŸœŸœ ก˜%K–*Postfix"EightBitTimesRoman" family<šŸœŸœ ก.˜AK–*Postfix"EightBitTimesRoman" familyBšŸœŸœ ก4˜GK–*Postfix"EightBitTimesRoman" familyCšŸœŸœ ก5˜HK–*Postfix"EightBitTimesRoman" familyCšŸœŸœ ก5˜HK–*Postfix"EightBitTimesRoman" familyHšŸœŸœ ก:˜MK–*Postfix"EightBitTimesRoman" family<šŸœŸœ ก.˜AK–*Postfix"EightBitTimesRoman" familyCšŸœŸœ ก5˜HK–*Postfix"EightBitTimesRoman" familyDšŸœŸœ ก6˜IK–*Postfix"EightBitTimesRoman" familyšŸœŸœ ก ˜ K–*Postfix"EightBitTimesRoman" familyšŸœŸœ ก˜!K–*Postfix"EightBitTimesRoman" familyšŸœŸœ ก ˜!K–*Postfix"EightBitTimesRoman" familyšŸœŸœ ก˜#K–*Postfix"EightBitTimesRoman" familyšŸœŸœ ก˜#K–*Postfix"EightBitTimesRoman" familyšŸœŸœ ก ˜ K–*Postfix"EightBitTimesRoman" familyšŸœŸœ ก ˜!K–*Postfix"EightBitTimesRoman" family šŸœŸœ ก˜%K–*Postfix"EightBitTimesRoman" family"šŸœŸœ ก˜'K–*Postfix"EightBitTimesRoman" family$šŸœŸœ ก˜)K–*Postfix"EightBitTimesRoman" family-šŸœŸœ ก˜2K–*Postfix"EightBitTimesRoman" family!šŸœŸœ ก˜&K–*Postfix"EightBitTimesRoman" family0šŸœŸœก"˜5K–*Postfix"EightBitTimesRoman" family<šŸœŸœ ก.˜AK–*Postfix"EightBitTimesRoman" familyEšŸœŸœก8˜JK˜K˜—šœŸœ˜K™QKšŸœŸœ ก&˜Kš ŸœฆœŸœ กขก˜?KšŸœฆœŸœ ก˜)KšŸœฆœŸœ ก˜,KšŸœฆœŸœ ก˜,KšŸœฆœŸœ ก"˜6KšŸœฆœŸœ ก˜1KšŸœฆœŸœ ก˜0KšŸœฆœŸœ ก˜*KšŸœฆœŸœ ก˜,KšŸœฆœŸœ ก˜)KšŸœฆœŸœ ก˜*KšŸœฆœŸœ ก˜'KšŸœฆœŸœ ก˜(KšŸœฆœŸœ ก˜,KšŸœฆœŸœ ก˜/KšŸœฆœŸœ ก˜*KšŸœฆœŸœ ก˜.KšŸœฆœŸœ ก!˜5KšŸœฆœŸœ ก˜-KšŸœฆœŸœ ก˜+KšŸœฆœŸœ ก˜*KšŸœฆœŸœ ก˜,KšŸœฆœŸœ ก˜-KšŸœฆœŸœ ก˜0KšŸœฆœŸœ ก˜/KšŸœฆœŸœ ก˜0KšŸœฆœŸœ ก˜/KšŸœฆœŸœ ก˜(KšŸœฆœŸœ ก˜(KšŸœฆœŸœ ก˜(KšŸœฆœŸœก˜-Kšœ˜K˜—šœŸœก#˜CK–"Postfix"OldEnglish" family,šŸœŸœก˜1Kšœ˜K˜—šœŸœ˜KšœŸ™K–Postfix "Sail" family!šŸœŸœ ก˜&K–Postfix "Sail" familyšŸœŸœ กฃก˜ K–Postfix "Sail" familyšŸœŸœ กฃก˜K–Postfix "Sail" family#šŸœŸœ กฃก ˜(K–Postfix "Sail" family#šŸœŸœ กฃก ˜(K–Postfix "Sail" family!šŸœŸœ กฃก ˜&K–Postfix "Sail" familyšŸœŸœ กฃก˜K–Postfix "Sail" familyšŸœŸœ กฃก˜!K–Postfix "Sail" family%šŸœŸœ กฃก™*K–Postfix "Sail" family%šŸœŸœ กฃก™*K–Postfix "Sail" family šŸœŸœ กฃก ˜%K–Postfix "Sail" family*šŸœŸœ กฃก˜/K–Postfix "Sail" family$šŸœŸœ กฃก˜)K–Postfix "Sail" family šŸœŸœ กฃก ˜%K–Postfix "Sail" family$šŸœŸœ กฃก˜)K–Postfix "Sail" familyšŸœŸœ กฃก˜"K–Postfix "Sail" familyšŸœŸœ กฃก ˜$K–Postfix "Sail" family$šŸœŸœ กฃก˜)K–Postfix "Sail" family(šŸœŸœ กฃก˜-K–Postfix "Sail" family(šŸœŸœ กฃก˜-K–Postfix "Sail" family!šŸœŸœ กฃก ˜&K–Postfix "Sail" family"šŸœŸœ กฃก ˜'K–Postfix "Sail" family#šŸœŸœ กฃก˜(K–Postfix "Sail" family!šŸœŸœ กฃก ˜&K–Postfix "Sail" family*šŸœŸœ กฃก˜/K–Postfix "Sail" family-šŸœŸœ กฃก˜2K–Postfix "Sail" family!šŸœŸœ กฃก ˜&K–Postfix "Sail" family"šŸœŸœ กฃก ˜'K–Postfix "Sail" family/šŸœŸœก"˜4K˜K˜——™ KšœŸœ ˜KšœŸœŸœ ก˜3šœŸœ ก˜&K˜—š ฯn œŸœŸœŸœŸœ˜DK™UKšœŸœ"˜.šŸœŸœŸœ˜KšœŸœก3˜HKšœŸœ#ก˜NKšœ˜—K˜K˜—š ง œŸœŸœŸœŸœ˜DK™กK™KšŸœ$˜+—K˜Kšœ(ก˜BKšœ˜—K˜K˜—šงœŸ œŸœŸœ˜7K˜—š œŸœŸœŸœŸœŸœŸœ˜8K™6K˜—šงœŸ œ3Ÿœ˜]Kšœ1žœq™ฆKšœŸœ ˜Kš ŸœŸœŸœŸœŸœŸœ˜3šŸœ.ŸœŸœŸ˜DšŸœ1Ÿœ ŸœŸ˜HKšœŸœ˜š ŸœŸœŸœŸœŸœŸœŸ˜