LibreOffice Module unotools (master) 1
Functions
fontdefs.cxx File Reference
#include <o3tl/safeint.hxx>
#include <o3tl/string_view.hxx>
#include <unotools/fontdefs.hxx>
#include <unotools/fontcfg.hxx>
#include <rtl/ustrbuf.hxx>
#include <string_view>
#include <unordered_map>
Include dependency graph for fontdefs.cxx:

Go to the source code of this file.

Functions

OUString StripScriptFromName (const OUString &_aName)
 Strip any "script font suffix" from the font name. More...
 
static bool toOnlyLowerAsciiOrStrip (sal_Unicode c, OUStringBuffer &rName, sal_Int32 nIndex, sal_Int32 &rLen)
 
OUString GetEnglishSearchFontName (std::u16string_view rInName)
 
std::u16string_view GetNextFontToken (std::u16string_view rTokenStr, sal_Int32 &rIndex)
 
static bool ImplIsFontToken (std::u16string_view rName, std::u16string_view rToken)
 
static void ImplAppendFontToken (OUString &rName, std::u16string_view rNewToken)
 
void AddTokenFontName (OUString &rName, std::u16string_view rNewToken)
 
OUString GetSubsFontName (std::u16string_view rName, SubsFontFlags nFlags)
 
bool IsOpenSymbol (std::u16string_view rFontName)
 Determine if the font is the special Open|Star Symbol font. More...
 

Function Documentation

◆ AddTokenFontName()

void AddTokenFontName ( OUString &  rName,
std::u16string_view  rNewToken 
)

Definition at line 368 of file fontdefs.cxx.

References ImplAppendFontToken(), ImplIsFontToken(), and rNewToken.

◆ GetEnglishSearchFontName()

OUString GetEnglishSearchFontName ( std::u16string_view  rInName)

Definition at line 86 of file fontdefs.cxx.

References i, toOnlyLowerAsciiOrStrip(), and u.

Referenced by CreateFontToSubsFontConverter(), and GetSubsFontName().

◆ GetNextFontToken()

std::u16string_view GetNextFontToken ( std::u16string_view  rTokenStr,
sal_Int32 &  rIndex 
)

Definition at line 301 of file fontdefs.cxx.

References o3tl::make_unsigned().

Referenced by GetSubsFontName(), ImplIsFontToken(), and IsOpenSymbol().

◆ GetSubsFontName()

OUString GetSubsFontName ( std::u16string_view  rName,
SubsFontFlags  nFlags 
)

◆ ImplAppendFontToken()

static void ImplAppendFontToken ( OUString &  rName,
std::u16string_view  rNewToken 
)
static

Definition at line 359 of file fontdefs.cxx.

References rNewToken.

Referenced by AddTokenFontName(), and GetSubsFontName().

◆ ImplIsFontToken()

static bool ImplIsFontToken ( std::u16string_view  rName,
std::u16string_view  rToken 
)
static

Definition at line 345 of file fontdefs.cxx.

References GetNextFontToken(), and nIndex.

Referenced by AddTokenFontName(), and GetSubsFontName().

◆ IsOpenSymbol()

bool IsOpenSymbol ( std::u16string_view  rFontName)

Determine if the font is the special Open|Star Symbol font.

Parameters
rFontNameThe FontName to test for being Open|Star Symbol
Returns
true if this is Open|Star Symbol

Definition at line 406 of file fontdefs.cxx.

References o3tl::equalsIgnoreAsciiCase(), GetNextFontToken(), and nIndex.

◆ StripScriptFromName()

OUString StripScriptFromName ( const OUString &  rName)

Strip any "script font suffix" from the font name.

Related: fdo#49271 RTF files often contain weird-ass Win 3.1/Win95 style fontnames which attempt to put the charset encoding into the filename http://www.webcenter.ru/~kazarn/eng/fonts_ttf.htm

Definition at line 29 of file fontdefs.cxx.

References aName.

◆ toOnlyLowerAsciiOrStrip()

static bool toOnlyLowerAsciiOrStrip ( sal_Unicode  c,
OUStringBuffer &  rName,
sal_Int32  nIndex,
sal_Int32 &  rLen 
)
static

Definition at line 64 of file fontdefs.cxx.

References nIndex.

Referenced by GetEnglishSearchFontName().