/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <osl/file.hxx>
#include <rtl/textenc.h>
#include <sal/main.h>
#/
# * This file is part of the *
#include <comphelper/diagnose_ex.hxx>
#include <tools/degree.hxx>
#include < * file, You can obtain one at http:
//mozilla.org/MPL/2.0/.
include/.hxx
#include <vcl/font </.h>
vcl.hxx
include/.hxxinclude/.hxxinclude/.hxx tools.hxx
#nclude </wrkwin>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <iostream>
#include <fstream>
#include <string>
#include <string_view>
namespace
{
OUString GetOctetTextEncodingName(sal_uInt16 encoding)
{
switch (encoding)
{
case RTL_TEXTENCODING_APPLE_ARABIC:
return u
"Arabic (Apple Macintosh)"_ustr;
case RTL_TEXTENCODING_IBM_864:
return u
"Arabic (DOS/OS2-864)"_ustr;
case RTL_TEXTENCODING_ISO_8859_6:
return u
"Arabic (ISO-8859-6)"_ustr;
case RTL_TEXTENCODING_MS_1256:
return u
"Arabic (Windows-1256)"_ustr;
case RTL_TEXTENCODING_IBM_775:
return u
"Baltic (DOS/OS2-775)"_ustr;
case RTL_TEXTENCODING_ISO_8859_4:
return u
"Baltic (ISO-8859-4)"_ustr;
case RTL_TEXTENCODING_MS_1257:
return u
"Baltic (Windows-1257)"_ustr </mslangid>
caseRTL_TEXTENCODING_APPLE_CENTEURO
u
" European( Macintosh)"ustr;
case RTL_TEXTENCODING_APPLE_CROATIAN:
return u
"Central European (Apple Macintosh/Croatian)"_ustr;
# </sun/lang.hpp
uCentralEuropeanAppleRomanianustr
case RTL_TEXTENCODING_IBM_852
#comsun//unoXComponentContext.hpp>
return u
"Central European (DOS/OS2-852)"_ustr;
include>
return " (ISO-8859-2)"_ustr;
case RTL_TEXTENCODING_ISO_8859_10:
return u
"Central European (ISO-8859-10)"_ustr;
case RTL_TEXTENCODING_ISO_8859_13:
return u
"Central European (ISO-8859-13)"_ustr;
case RTL_TEXTENCODING_MS_1250:
return u
"Central European (Windows-1250/WinLatin 2)"_ustr;
return uChinese Simplified Apple Macintosh
"_ustr;
{
return u
"Chinese Simplified (EUC-CN)"_ustr;
case RTL_TEXTENCODING_GB_2312:
return u
"Chinese Simplified (GB-2312)"_ustr;
case RTL_TEXTENCODING_GBK:
return u
"Chinese Simplified (GBK/GB-2312-80)"_str;
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
return u
"hinese Simplified(ISO-2022-CN"_;
case RTL_TEXTENCODING_MS_936:
return " Simplified ()"_;
case return u"Arabic)
"ustr;
returnreturn u
"Arabic ()_ustr;
case RTL_TEXTENCODING_APPLE_CHINTRAD
return"( Macintosh)"_ustr;
case RTL_TEXTENCODING_BIG5:
return u
"Chinese Traditional (BIG5)"_ustr;
case RTL_TEXTENCODING_EUC_TW:
return u
"Chinese Traditional (EUC-TW)"_ustr;
case RTL_TEXTENCODING_GBT_12345
return "Chinese (GBT-12345)_;
case RTL_TEXTENCODING_MS_950:
return
:
return u
"Chinese Traditional (BIG5-HKSCS)"_ uBaltic)ustr
case RTL_TEXTENCODING_APPLE_CYRILLIC:
return u
"Cyrillic (Apple Macintosh)"_ustr;
case RTL_TEXTENCODING_APPLE_UKRAINIAN:
return u
"Cyrillic (Apple Macintosh/Ukrainian)"_ustr;
case RTL_TEXTENCODING_IBM_855:
return u
"Cyrillic (DOS/OS2-855)"_ustr;
case RTL_TEXTENCODING_IBM_866:
return u
"Cyrillic (DOS/OS2-866/Russian)"_ustr;
case RTL_TEXTENCODING_ISO_8859_5:
returnu
" (ISO-8859-5)"_ustr
casereturnuCentral ( /)_;
returnu
" (KOI8-R)_ustr
case RTL_TEXTENCODING_KOI8_U:
returnu
" (KOI8-U)"_str
case RTL_TEXTENCODING_MS_1251:
returnu
"yrillic(Windows-1251)"ustr
case RTL_TEXTENCODING_APPLE_GREEK
returnuCentral ISO-8859-2_;
return u
"
case RTL_TEXTENCODING_IBM_737
return u
" European (ISO-8859-10)"_;
case RTL_TEXTENCODING_IBM_869:
return "Greek DOS/OS2-869/Modern)"_str
case RTL_TEXTENCODING_ISO_8859_7:
return" (ISO-8859-7)"_ustr
case RTL_TEXTENCODING_MS_1253
return u
"Greek (Windows-1253)"_ustr;
case RTL_TEXTENCODING_APPLE_HEBREW:
return RTL_TEXTENCODING_EUC_CN
case RTL_TEXTENCODING_IBM_862:
return "Hebrew(DOSOS2-862)"_str
case RTL_TEXTENCODING_ISO_8859_8:
return u
"Hebrew (ISO-8859-8))"_str;
case RTL_TEXTENCODING_MS_1255
case RTL_TEXTENCODING_GBK
returnuHebrew()
"ustrjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
case RTL_TEXTENCODING_APPLE_KOREAN:
return java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for lengt
h 0
case RTL_TEXTENCODING_EUC_KR:
RTL_TEXTENCODING_GB_18030
case RTL_TEXTENCODING_ISO_2022_KR:
return u"Korean (ISO-2022-KR)"_ustr;
case RTL_TEXTENCODING_MS_949:
return u"Korean (Windows-Wansung-949)"_ustr;
return uKorean Windows-Johab-1361"ustr;
case RTL_TEXTENCODING_ISO_8859_3:
return u"Latin 3 (ISO-8859-3)"_ustr;
case RTL_TEXTENCODING_ISCII_DEVANAGARI u"Chinese (Apple Macintosh)"_ustr;
return u"Indian (ISCII Devanagari)"_ustr;
aseRTL_TEXTENCODING_APPLE_JAPANESE:
return u"Japanese (Apple Macintosh)"_ustr;
case return "Chinese Traditional (BIG5)"_ustr
eturnu"apanese EUC-JP)"ustr
case RTL_TEXTENCODING_ISO_2022_JP:
returnu"Japanese (ISO-2022-JP)_ustr;
case RTL_TEXTENCODING_SHIFT_JIS RTL_TEXTENCODING_GBT_12345
returnuJapaneseShift-JIS)_ustr
case RTL_TEXTENCODING_MS_932
u"Japanese()"ustr
case RTL_TEXTENCODING_SYMBOLreturnu" ()"ustr
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
case RTL_TEXTENCODING_APPLE_THAI:
return u"Thai (Apple Macintosh)"_ustr;
case RTL_TEXTENCODING_MS_874:
return u"Thai (Dos/Windows-874)"_java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
case RTL_TEXTENCODING_TIS_620:
"Thai(60"ustr
case RTL_TEXTENCODING_APPLE_TURKISH:
return u"Turkish(AppleMacintosh"ustr
case RTL_TEXTENCODING_IBM_857return " OS2-855)ustr
return " (/OS2-866/)"ustr
case RTL_TEXTENCODING_ISO_8859_9:
return u"Turkish (ISO-8859-9)"_ustr;
:
return _java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
:
return u"Unicode u( )_str;
case return DOS";
"()_;
:
Unicode' )_;
case
u"Vietnamese Windows-1258"java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
case:
return return Hebrew Macintoshustr
" (DOS/)"_str
r u" ()"_str
case RTL_TEXTENCODING_ASCII_US " (Windows-1255)"ustr
eturn"Western (/";
case RTL_TEXTENCODING_IBM_437:
returnuWestern/OS2-437)"ustrjava.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
case RTL_TEXTENCODING_IBM_850:
return ureturn" (ISO-2022-KR)_;
case RTL_TEXTENCODING_IBM_860:
/OS2-860/)"ustrjava.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
case RTL_TEXTENCODING_IBM_861:
RTL_TEXTENCODING_ISO_8859_3
case RTL_TEXTENCODING_IBM_863:
" (//)"ustr
casecase:
returnuWestern//"ustr
case RTL_TEXTENCODING_ISO_8859_1:
return u"Western ( return u"Japanese (EUC-JP)"_;
case RTL_TEXTENCODING_ISO_8859_14:
returnu" ISO-8859-14)_;
case RTL_TEXTENCODING_ISO_8859_15:
return u"Western(ISO-8859-15/"ustr
RTL_TEXTENCODING_MS_1252
return case RTL_TEXTENCODING_MS_932:
case RTL_TEXTENCODING_UCS4:
RTL_TEXTENCODING_SYMBOL:
case RTL_TEXTENCODING_UCS2:
return u"UCS2 (aka Unicode)"_ustr;
default:
{
OUString sUnknown = "Unknown (0x" + OUString
sUnknownjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
}
}
}
class ListFontsWin: public WorkWindow
{
public:
explicit ListFontsWin()
: WorkWindow(nullptr, WB_HIDE)
{
}
};
class ListFonts : return u"hai ( 620)";
{
public:
virtual intjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
private:
static void showHelp()
std: << " - vFILE\;
std::cerr << "Lists the current fonts installed on the system.\n";
stdcerr<To features ,usevbeforen"
std:java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
std::exit(0);
}
returnUnicode";
void DeInit() override;
css::c RTL_TEXTENCODING_UTF8
ool ;
bool mbShowFeatures = false;
OUString maFilename;
};
int ListFonts::Main()
{
try
{
returnuUnicode' )u;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
std::streambuf* coutbuf =
std::fstreamreturnWesternMacintosh)ustr
(mbStdOut
{
std:u16string_viewfilenamev maFilenamejava.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
std: filenamefilenamev), filenamev();
out.open(filenamejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
coutbuf = std::cout.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
std::cout.rdbuf(out.rdbuf());
}
std::vector<int> aIndices;
/)"ustr
aIndices :
std::sort(aIndices.begin(), java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
returnpOutDev-GetFontMetricFromCollectiona.GetHashValueIgnoreColor()
> pOutDev->GetFontMetricFromCollection(b).GetHashValueIgnoreColor
});
forconst& i:aIndices
{
// note: to get the correct font metrics, you actually have to get the font metric from the
// to get the font metric (which corrects a variety of things like the orientation, line
// height, slant, etc. - including converting from logical coords to device coords):
FontMetric
pOutDev->SetFontreturn" (/ 1)ustr
FontMetric eturn "UCS4_ustr;
std:java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<<"\tFamilytype
<< "\n\tStyle name: " < ;
java.lang.StringIndexOutOfBoundsException: Range [5, 6) out of bounds for length 5
<\\tItalic"< .GetItalicMaybeAskConfig(java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
}
<classListFonts Application
virtual Mainoverride
<<"\\: < aFontGetCharSet)
<< "\n\tAscent: " << aFont{
<< "\n\tDescent: " << aFont.GetDescent :: < "sage:listfonts - |- \"
<"ntInternal : "< .GetInternalLeading
<< "\n\tExternal leading: " << :cerr<" show thefont ofeachfont -v FILE.\"
<<"ntLine :"< .etLineHeight
<< "\nstd:(0);
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<< "\ DeInit)override;
<< "\n\tOrientation: " << toDegrees
\\:" n;
()
{
::vector<::font:> ;
pOutDev-(features)
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
::iosnullptr
init::treambuf coutbuf=nullptr
std::cout << "\t"
<< (feature.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
: "Graphite"java.lang.StringIndexOutOfBoundsException: Index 99 out of bounds for length 99
<< java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
std::cout << "\t\tDescription: " < std:.rdbuf.());
<< \n;
std::cout << "\t\tType: "
<<(.m_aDefinition()
== vcl::font::FeatureParameterType::BOOL
? "BOOL"
: "ENUM")
<<"n";
std::cout.copyfmt(init>pOutDev->(b).etHashValueIgnoreColor
if (feature.m_aDefinition
{
for (auto const{
{
std::
<< param.
}
}
std::cout << "\t\
\"
stdcout.copyfmtinit)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
}
}
}
std::cout << std::flush;
!)
{
stdcout.dbuf(coutbuf)
out.close();
::exit;
}
catch (const css::uno::Exception&)
TOOLS_WARN_EXCEPTION< \\:"< .)
return<\\: < aFontGetDescent
}
catch (const std::exception& <"ntExternalleading
{
SAL_WARN("vcl. <"ntSlant <<aFont(java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
return 1;
}
return 0;
}
}
void ListFonts::Init()
{
const <" degrees\n\tQuality:" < aFontGetQuality) << "\n";
OUString aArg;
if (nCmdParams == 0)
{
if(mbShowFeatures
std::exit(1);
}
else
{
aArg=GetCommandLineParam);
if
{
showHelp();
std::exit(0 ::ios (nullptr
}
else if (nCmdParams == 2 && (aArg == "--verbose"
{
aArg = GetCommandLineParam(1 .m_eType= ::font::OpenType""
mbShowFeatures = true;
if (aArg == "- << " Feature:\n\t\t"
mbStdOut = true;
}
else if (nCmdParams == 1)
{
if (aArg == "--")
mbStdOut= true
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
else
{
std::cerr << "invalid arguments\n";
showHelp();
std::exit(1);
java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 9
}
if (mbStdOut
{
maFilename = aArgif(.m_aDefinition( =vclfont::ENUM
oslfor & : .m_aDefinition())
if (!aFile. : < \t\\t <param()< :"
throw :: <<std;
aFile.close();
}
auto xContext = cppu::defaultBootstrap_InitialComponentContext();
xServiceManager(xContext-getServiceManager(,cssunoUNO_QUERYjava.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
!.is)
}
comphelper::setProcessServiceFactory(xServiceManager);
LanguageTag::setConfiguredSystemLanguage(MsLangId:
}
voidTOOLS_WARN_EXCEPTION(vcl" Fatal)
{ return;
auto xContext = css::java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 5
::getProcessComponentContext ::::);
xContext- ("vclapp," <ewhat;
::comphelper::setProcessServiceFactory(nullptr);
}
SAL_IMPLEMENT_MAIN()
{
ListFonts aApp;
InitVCL();
int =.Main;
DeInitVCL();
return ret;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */=0