unipdf/pdf/internal/textencoding/simple_symbol.go

229 lines
6.8 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* This file is subject to the terms and conditions defined in
* file 'LICENSE.md', which is part of this source code package.
*/
package textencoding
import "sync"
const baseSymbol = "SymbolEncoding"
var (
symbolOnce sync.Once
symbolRuneToChar map[rune]byte
)
func init() {
RegisterSimpleEncoding(baseSymbol, NewSymbolEncoder)
}
// NewSymbolEncoder returns a SimpleEncoder that implements SymbolEncoding.
func NewSymbolEncoder() SimpleEncoder {
symbolOnce.Do(initSymbol)
return &simpleEncoding{
baseName: baseSymbol,
encode: symbolRuneToChar,
decode: symbolCharToRune,
}
}
func initSymbol() {
symbolRuneToChar = make(map[rune]byte, len(symbolRuneToChar))
for b, r := range symbolCharToRune {
symbolRuneToChar[r] = b
}
}
var symbolCharToRune = map[byte]rune{ // 189 entries
0x20: 0x0020, // "space"
0x21: 0x0021, // ! "exclam"
0x22: 0x2200, // ∀ "universal"
0x23: 0x0023, // # "numbersign"
0x24: 0x2203, // ∃ "existential"
0x25: 0x0025, // % "percent"
0x26: 0x0026, // & "ampersand"
0x27: 0x220b, // ∋ "suchthat"
0x28: 0x0028, // ( "parenleft"
0x29: 0x0029, // ) "parenright"
0x2a: 0x2217, // "asteriskmath"
0x2b: 0x002b, // + "plus"
0x2c: 0x002c, // , "comma"
0x2d: 0x2212, // "minus"
0x2e: 0x002e, // . "period"
0x2f: 0x002f, // / "slash"
0x30: 0x0030, // 0 "zero"
0x31: 0x0031, // 1 "one"
0x32: 0x0032, // 2 "two"
0x33: 0x0033, // 3 "three"
0x34: 0x0034, // 4 "four"
0x35: 0x0035, // 5 "five"
0x36: 0x0036, // 6 "six"
0x37: 0x0037, // 7 "seven"
0x38: 0x0038, // 8 "eight"
0x39: 0x0039, // 9 "nine"
0x3a: 0x003a, // : "colon"
0x3b: 0x003b, // ; "semicolon"
0x3c: 0x003c, // < "less"
0x3d: 0x003d, // = "equal"
0x3e: 0x003e, // > "greater"
0x3f: 0x003f, // ? "question"
0x40: 0x2245, // ≅ "congruent"
0x41: 0x0391, // Α "Alpha"
0x42: 0x0392, // Β "Beta"
0x43: 0x03a7, // Χ "Chi"
0x44: 0x2206, // ∆ "Delta"
0x45: 0x0395, // Ε "Epsilon"
0x46: 0x03a6, // Φ "Phi"
0x47: 0x0393, // Γ "Gamma"
0x48: 0x0397, // Η "Eta"
0x49: 0x0399, // Ι "Iota"
0x4a: 0x03d1, // ϑ "theta1"
0x4b: 0x039a, // Κ "Kappa"
0x4c: 0x039b, // Λ "Lambda"
0x4d: 0x039c, // Μ "Mu"
0x4e: 0x039d, // Ν "Nu"
0x4f: 0x039f, // Ο "Omicron"
0x50: 0x03a0, // Π "Pi"
0x51: 0x0398, // Θ "Theta"
0x52: 0x03a1, // Ρ "Rho"
0x53: 0x03a3, // Σ "Sigma"
0x54: 0x03a4, // Τ "Tau"
0x55: 0x03a5, // Υ "Upsilon"
0x56: 0x03c2, // ς "sigma1"
0x57: 0x2126, // Ω "Omega"
0x58: 0x039e, // Ξ "Xi"
0x59: 0x03a8, // Ψ "Psi"
0x5a: 0x0396, // Ζ "Zeta"
0x5b: 0x005b, // [ "bracketleft"
0x5c: 0x2234, // ∴ "therefore"
0x5d: 0x005d, // ] "bracketright"
0x5e: 0x22a5, // ⊥ "perpendicular"
0x5f: 0x005f, // _ "underscore"
0x60: 0xf8e5, // "radicalex"
0x61: 0x03b1, // α "alpha"
0x62: 0x03b2, // β "beta"
0x63: 0x03c7, // χ "chi"
0x64: 0x03b4, // δ "delta"
0x65: 0x03b5, // ε "epsilon"
0x66: 0x03c6, // φ "phi"
0x67: 0x03b3, // γ "gamma"
0x68: 0x03b7, // η "eta"
0x69: 0x03b9, // ι "iota"
0x6a: 0x03d5, // ϕ "phi1"
0x6b: 0x03ba, // κ "kappa"
0x6c: 0x03bb, // λ "lambda"
0x6d: 0x00b5, // µ "mu"
0x6e: 0x03bd, // ν "nu"
0x6f: 0x03bf, // ο "omicron"
0x70: 0x03c0, // π "pi"
0x71: 0x03b8, // θ "theta"
0x72: 0x03c1, // ρ "rho"
0x73: 0x03c3, // σ "sigma"
0x74: 0x03c4, // τ "tau"
0x75: 0x03c5, // υ "upsilon"
0x76: 0x03d6, // ϖ "omega1"
0x77: 0x03c9, // ω "omega"
0x78: 0x03be, // ξ "xi"
0x79: 0x03c8, // ψ "psi"
0x7a: 0x03b6, // ζ "zeta"
0x7b: 0x007b, // { "braceleft"
0x7c: 0x007c, // | "bar"
0x7d: 0x007d, // } "braceright"
0x7e: 0x223c, // "similar"
0xa0: 0x20ac, // € "Euro"
0xa1: 0x03d2, // ϒ "Upsilon1"
0xa2: 0x2032, // "minute"
0xa3: 0x2264, // ≤ "lessequal"
0xa4: 0x2044, // "fraction"
0xa5: 0x221e, // ∞ "infinity"
0xa6: 0x0192, // ƒ "florin"
0xa7: 0x2663, // ♣ "club"
0xa8: 0x2666, // ♦ "diamond"
0xa9: 0x2665, // ♥ "heart"
0xaa: 0x2660, // ♠ "spade"
0xab: 0x2194, // ↔ "arrowboth"
0xac: 0x2190, // ← "arrowleft"
0xad: 0x2191, // ↑ "arrowup"
0xae: 0x2192, // → "arrowright"
0xaf: 0x2193, // ↓ "arrowdown"
0xb0: 0x00b0, // ° "degree"
0xb1: 0x00b1, // ± "plusminus"
0xb2: 0x2033, // ″ "second"
0xb3: 0x2265, // ≥ "greaterequal"
0xb4: 0x00d7, // × "multiply"
0xb5: 0x221d, // ∝ "proportional"
0xb6: 0x2202, // ∂ "partialdiff"
0xb7: 0x2022, // • "bullet"
0xb8: 0x00f7, // ÷ "divide"
0xb9: 0x2260, // ≠ "notequal"
0xba: 0x2261, // ≡ "equivalence"
0xbb: 0x2248, // ≈ "approxequal"
0xbc: 0x2026, // … "ellipsis"
0xbd: 0xf8e6, // "arrowvertex"
0xbe: 0xf8e7, // "arrowhorizex"
0xbf: 0x21b5, // ↵ "carriagereturn"
0xc0: 0x2135, // ℵ "aleph"
0xc1: 0x2111, // "Ifraktur"
0xc2: 0x211c, // "Rfraktur"
0xc3: 0x2118, // ℘ "weierstrass"
0xc4: 0x2297, // ⊗ "circlemultiply"
0xc5: 0x2295, // ⊕ "circleplus"
0xc6: 0x2205, // ∅ "emptyset"
0xc7: 0x2229, // ∩ "intersection"
0xc8: 0x222a, // "union"
0xc9: 0x2283, // ⊃ "propersuperset"
0xca: 0x2287, // ⊇ "reflexsuperset"
0xcb: 0x2284, // ⊄ "notsubset"
0xcc: 0x2282, // ⊂ "propersubset"
0xcd: 0x2286, // ⊆ "reflexsubset"
0xce: 0x2208, // ∈ "element"
0xcf: 0x2209, // ∉ "notelement"
0xd0: 0x2220, // ∠ "angle"
0xd1: 0x2207, // ∇ "gradient"
0xd2: 0xf6da, // "registerserif"
0xd3: 0xf6d9, // "copyrightserif"
0xd4: 0xf6db, // "trademarkserif"
0xd5: 0x220f, // ∏ "product"
0xd6: 0x221a, // √ "radical"
0xd7: 0x22c5, // ⋅ "dotmath"
0xd8: 0x00ac, // ¬ "logicalnot"
0xd9: 0x2227, // ∧ "logicaland"
0xda: 0x2228, // "logicalor"
0xdb: 0x21d4, // ⇔ "arrowdblboth"
0xdc: 0x21d0, // ⇐ "arrowdblleft"
0xdd: 0x21d1, // ⇑ "arrowdblup"
0xde: 0x21d2, // ⇒ "arrowdblright"
0xdf: 0x21d3, // ⇓ "arrowdbldown"
0xe0: 0x25ca, // ◊ "lozenge"
0xe1: 0x2329, // 〈 "angleleft"
0xe2: 0xf8e8, // "registersans"
0xe3: 0xf8e9, // "copyrightsans"
0xe4: 0xf8ea, // "trademarksans"
0xe5: 0x2211, // ∑ "summation"
0xe6: 0xf8eb, // "parenlefttp"
0xe7: 0xf8ec, // "parenleftex"
0xe8: 0xf8ed, // "parenleftbt"
0xe9: 0xf8ee, // "bracketlefttp"
0xea: 0xf8ef, // "bracketleftex"
0xeb: 0xf8f0, // "bracketleftbt"
0xec: 0xf8f1, // "bracelefttp"
0xed: 0xf8f2, // "braceleftmid"
0xee: 0xf8f3, // "braceleftbt"
0xef: 0xf8f4, // "braceex"
0xf1: 0x232a, // 〉 "angleright"
0xf2: 0x222b, // ∫ "integral"
0xf3: 0x2320, // ⌠ "integraltp"
0xf4: 0xf8f5, // "integralex"
0xf5: 0x2321, // ⌡ "integralbt"
0xf6: 0xf8f6, // "parenrighttp"
0xf7: 0xf8f7, // "parenrightex"
0xf8: 0xf8f8, // "parenrightbt"
0xf9: 0xf8f9, // "bracketrighttp"
0xfa: 0xf8fa, // "bracketrightex"
0xfb: 0xf8fb, // "bracketrightbt"
0xfc: 0xf8fc, // "bracerighttp"
0xfd: 0xf8fd, // "bracerightmid"
0xfe: 0xf8fe, // "bracerightbt"
}