[Libreoffice-commits] core.git: 3 commits - connectivity/source vcl/generic vcl/source
Caolán McNamara
caolanm at redhat.com
Fri Sep 12 02:29:04 PDT 2014
connectivity/source/drivers/calc/CDatabaseMetaData.cxx | 2
connectivity/source/drivers/dbase/DDatabaseMetaData.cxx | 2
vcl/generic/fontmanager/fontmanager.cxx | 72 ++++++++++++++++
vcl/source/fontsubset/sft.cxx | 11 +-
4 files changed, 80 insertions(+), 7 deletions(-)
New commits:
commit 9436ae99438ccc24a86aff61aaa9174a9686814f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Sep 12 10:20:48 2014 +0100
Related: fdo#82259 implement mac ttf fontname encoding support
which is why these font's are not appearing under Linux
Change-Id: Ib72ddb465b2df729953ece416cfa0477cd565bcd
diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx
index edc2be1..725fc87 100644
--- a/vcl/generic/fontmanager/fontmanager.cxx
+++ b/vcl/generic/fontmanager/fontmanager.cxx
@@ -1018,6 +1018,65 @@ OUString PrintFontManager::convertTrueTypeName( void* pRecord ) const
}
}
}
+ else if( pNameRecord->platformID == 1 )
+ {
+ OString aName((const sal_Char*)(pNameRecord->sptr), pNameRecord->slen);
+ rtl_TextEncoding eEncoding = RTL_TEXTENCODING_DONTKNOW;
+ switch (pNameRecord->encodingID)
+ {
+ case 0:
+ eEncoding = RTL_TEXTENCODING_APPLE_ROMAN;
+ break;
+ case 1:
+ eEncoding = RTL_TEXTENCODING_APPLE_JAPANESE;
+ break;
+ case 2:
+ eEncoding = RTL_TEXTENCODING_APPLE_CHINTRAD;
+ break;
+ case 3:
+ eEncoding = RTL_TEXTENCODING_APPLE_KOREAN;
+ break;
+ case 4:
+ eEncoding = RTL_TEXTENCODING_APPLE_ARABIC;
+ break;
+ case 5:
+ eEncoding = RTL_TEXTENCODING_APPLE_HEBREW;
+ break;
+ case 6:
+ eEncoding = RTL_TEXTENCODING_APPLE_GREEK;
+ break;
+ case 7:
+ eEncoding = RTL_TEXTENCODING_APPLE_CYRILLIC;
+ break;
+ case 9:
+ eEncoding = RTL_TEXTENCODING_APPLE_DEVANAGARI;
+ break;
+ case 10:
+ eEncoding = RTL_TEXTENCODING_APPLE_GURMUKHI;
+ break;
+ case 11:
+ eEncoding = RTL_TEXTENCODING_APPLE_GUJARATI;
+ break;
+ case 21:
+ eEncoding = RTL_TEXTENCODING_APPLE_THAI;
+ break;
+ case 25:
+ eEncoding = RTL_TEXTENCODING_APPLE_CHINSIMP;
+ break;
+ case 29:
+ eEncoding = RTL_TEXTENCODING_APPLE_CENTEURO;
+ break;
+ case 32: //Uninterpreted
+ eEncoding = RTL_TEXTENCODING_UTF8;
+ break;
+ default:
+ SAL_WARN("vcl", "Unimplmented mac encoding " << pNameRecord->encodingID << " to unicode conversion");
+ break;
+ }
+ if (eEncoding != RTL_TEXTENCODING_DONTKNOW)
+ aValue = OStringToOUString(aName, eEncoding);
+ }
+
return aValue;
}
@@ -1077,8 +1136,21 @@ void PrintFontManager::analyzeTrueTypeFamilyName( void* pTTFont, ::std::list< OU
else
nMatch = 1000;
}
+ else if( pNameRecords[i].platformID == 1 )
+ {
+/*
+ // to-do, mac to LanguageType conversion
+ if( pNameRecords[i].languageID == aLang )
+ nMatch = 8000;
+ else*/ if( pNameRecords[i].languageID == 0 ) //English
+ nMatch = 2000;
+ else
+ nMatch = 1000;
+ }
OUString aName = convertTrueTypeName( pNameRecords + i );
aSet.insert( aName );
+ if (aName.isEmpty())
+ continue;
if( nMatch > nLastMatch || isBadTNR(aName, aSet) )
{
nLastMatch = nMatch;
commit 02f8f895f2abc4ee090b4bd42963590aa018fb49
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Sep 11 17:11:33 2014 +0100
Related: fdo#82259 support version 2 ttc fonts on Linux
a lot of Mac OSX fonts are in this format, and we're not
seeing them under Linux
Change-Id: I8a6974ccb43afadec320331eb26bc4a2df9b13c9
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index aca8885..1b5b477 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -1486,14 +1486,15 @@ static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t )
sal_uInt32 tdoffset = 0; /* offset to TableDirectory in a TTC file. For TTF files is 0 */
int indexfmt;
- sal_uInt32 version = GetInt32(t->ptr, 0, 1);
+ sal_uInt32 TTCTag = GetInt32(t->ptr, 0, 1);
- if ((version == 0x00010000) || (version == T_true)) {
+ if ((TTCTag == 0x00010000) || (TTCTag == T_true)) {
tdoffset = 0;
- } else if (version == T_otto) { /* PS-OpenType font */
+ } else if (TTCTag == T_otto) { /* PS-OpenType font */
tdoffset = 0;
- } else if (version == T_ttcf) { /* TrueType collection */
- if (GetUInt32(t->ptr, 4, 1) != 0x00010000) {
+ } else if (TTCTag == T_ttcf) { /* TrueType collection */
+ sal_uInt32 Version = GetUInt32(t->ptr, 4, 1);
+ if (Version != 0x00010000 && Version != 0x00020000) {
CloseTTFont(t);
return SF_TTFORMAT;
}
commit 682db177b035a78b460065d457abd5b2a66cc268
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Sep 11 15:44:02 2014 +0100
Normallya->Normally a
Change-Id: I988673d60f237951db36bdbb7064e6872102d96f
diff --git a/connectivity/source/drivers/calc/CDatabaseMetaData.cxx b/connectivity/source/drivers/calc/CDatabaseMetaData.cxx
index ad343a7..bb26ce9 100644
--- a/connectivity/source/drivers/calc/CDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/calc/CDatabaseMetaData.cxx
@@ -167,7 +167,7 @@ Reference< XResultSet > SAL_CALL OCalcDatabaseMetaData::getColumns(
if(match(tableNamePattern,*pTabIter,'\0'))
{
const Reference< XColumnsSupplier> xTable(xNames->getByName(*pTabIter),UNO_QUERY_THROW);
- OSL_ENSURE(xTable.is(),"Table not found! Normallya exception had to be thrown here!");
+ OSL_ENSURE(xTable.is(),"Table not found! Normally a exception had to be thrown here!");
aRow[3] = new ORowSetValueDecorator(*pTabIter);
const Reference< XNameAccess> xColumns = xTable->getColumns();
diff --git a/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx b/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
index bc37bdb..a754176 100644
--- a/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
@@ -181,7 +181,7 @@ Reference< XResultSet > SAL_CALL ODbaseDatabaseMetaData::getColumns(
{
Reference< XColumnsSupplier> xTable(
xNames->getByName(*pTabBegin), css::uno::UNO_QUERY);
- OSL_ENSURE(xTable.is(),"Table not found! Normallya exception had to be thrown here!");
+ OSL_ENSURE(xTable.is(),"Table not found! Normally a exception had to be thrown here!");
aRow[3] = new ORowSetValueDecorator(*pTabBegin);
Reference< XNameAccess> xColumns = xTable->getColumns();
More information about the Libreoffice-commits
mailing list