w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

Unicode Struct Reference

#include <Unicode.hpp>

Static Public Member Functions

static bool isValidCodepoint (uint32_t code)
 
static uint32_t charToCodepoint (uint32_t c)
 
static std::string utf8 (int32_t c)
 
static uint32_t fromSurrogate (uint32_t high, uint32_t low)
 
static uint32_t fromSurrogate (uint32_t cp)
 
static uint32_t toSurrogate (uint32_t cp)
 
static int32_t aglNameToCodepoint (const std::string &name)
 

Detailed Description

Unicode.hpp ** ** This file is part of dvisvgm – a fast DVI to SVG converter ** Copyright (C) 2005-2021 Martin Gieseking marti.nosp@m.n.gi.nosp@m.eseki.nosp@m.ng@u.nosp@m.os.de ** ** This program is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as ** published by the Free Software Foundation; either version 3 of ** the License, or (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, but ** WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, see http://www.gnu.org/licenses/. **

Definition at line 26 of file Unicode.hpp.

Member Function Documentation

◆ aglNameToCodepoint()

int32_t Unicode::aglNameToCodepoint ( const std::string name)
static

Returns the Unicode point for a given AGL character name.

Parameters
nameAGL name of the character to look up
Returns
codepoint of the character

Definition at line 207 of file Unicode.cpp.

References cp, extract_codepoint_from_name(), hash, hash2unicode, lower_bound, name, p1, p2, and XXH32().

Referenced by PhysicalFontImpl::unicode().

◆ charToCodepoint()

uint32_t Unicode::charToCodepoint ( uint32_t  c)
static

Returns a valid Unicode point for the given character code. Character codes that are invalid code points because the XML standard forbids or discourages their usage, are mapped to the Private Use Zone U+E000-U+F8FF.

Definition at line 56 of file Unicode.cpp.

References c, i, and gen-emoji-table::ranges.

Referenced by Font::unicode(), PhysicalFontImpl::unicode(), and NativeFontImpl::unicode().

◆ fromSurrogate() [1/2]

uint32_t Unicode::fromSurrogate ( uint32_t  surrogate)
static

Converts a surrogate value to its code point.

Parameters
[in]surrogatecombined high and low surrogate value
Returns
corresponding code point or 0 if the surrogate is invalid

Definition at line 132 of file Unicode.cpp.

References fromSurrogate().

◆ fromSurrogate() [2/2]

uint32_t Unicode::fromSurrogate ( uint32_t  high,
uint32_t  low 
)
static

Converts a surrogate pair to its code point.

Parameters
[in]highhigh-surrogate value (upper 16 bits)
[in]lowlow-surrogate value (lower 16 bits)
Returns
corresponding code point or 0 if the surrogate is invalid

Definition at line 121 of file Unicode.cpp.

References high, and low.

Referenced by SegmentedCMap::addBFRange(), SegmentedCMap::addCIDRange(), and fromSurrogate().

◆ isValidCodepoint()

bool Unicode::isValidCodepoint ( uint32_t  c)
static

Returns true if c is a valid Unicode point in XML documents. XML version 1.0 doesn't allow various Unicode character references (&#1; for example).

Definition at line 35 of file Unicode.cpp.

References c, i, and gen-emoji-table::ranges.

Referenced by fix_codepoint().

◆ toSurrogate()

uint32_t Unicode::toSurrogate ( uint32_t  cp)
static

Converts a code point of the surrogate range (0x10000–0x10FFFF) to its surrogate value.

Parameters
[in]cpcode point to convert
Returns
32-bit surrogate (combined high and low values)

Definition at line 141 of file Unicode.cpp.

References cp, high, and low.

◆ utf8()

string Unicode::utf8 ( int32_t  cp)
static

Converts a Unicode point to a UTF-8 byte sequence.

Parameters
[in]cpcode point
Returns
utf8 sequence consisting of 1-4 bytes

Definition at line 91 of file Unicode.cpp.

References cp.

Referenced by translate().


The documentation for this struct was generated from the following files: