diff options
Diffstat (limited to 'vcl/source/gdi/outdev3.cxx')
-rw-r--r-- | vcl/source/gdi/outdev3.cxx | 611 |
1 files changed, 26 insertions, 585 deletions
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index b6e0e1b8d441..51aad0790a26 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -56,10 +56,10 @@ #include <vcl/window.hxx> #include <vcl/svapp.hxx> #include <vcl/bmpacc.hxx> -#include <vcl/fontcvt.hxx> +#include <unotools/fontcvt.hxx> #include <vcl/outdev.hxx> #include <vcl/edit.hxx> -#include <vcl/fontcfg.hxx> +#include <unotools/fontcfg.hxx> #include <vcl/sysdata.hxx> #include <vcl/textlayout.hxx> #ifndef _OSL_FILE_H @@ -97,6 +97,7 @@ #include <memory> #include <algorithm> + // ======================================================================= DBG_NAMEEX( OutputDevice ) @@ -108,6 +109,7 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::rtl; using namespace ::vcl; +using namespace ::utl; // ======================================================================= @@ -305,451 +307,6 @@ void OutputDevice::ImplUpdateAllFontData( bool bNewFontLists ) // ======================================================================= -struct ImplLocalizedFontName -{ - const char* mpEnglishName; - const sal_Unicode* mpLocalizedNames; -}; - -static sal_Unicode const aBatang[] = { 0xBC14, 0xD0D5, 0, 0 }; -static sal_Unicode const aBatangChe[] = { 0xBC14, 0xD0D5, 0xCCB4, 0, 0 }; -static sal_Unicode const aGungsuh[] = { 0xAD81, 0xC11C, 0, 0 }; -static sal_Unicode const aGungsuhChe[] = { 0xAD81, 0xC11C, 0xCCB4, 0, 0 }; -static sal_Unicode const aGulim[] = { 0xAD74, 0xB9BC, 0, 0 }; -static sal_Unicode const aGulimChe[] = { 0xAD74, 0xB9BC, 0xCCB4, 0, 0 }; -static sal_Unicode const aDotum[] = { 0xB3CB, 0xC6C0, 0, 0 }; -static sal_Unicode const aDotumChe[] = { 0xB3CB, 0xC6C0, 0xCCB4, 0, 0 }; -static sal_Unicode const aSimSun[] = { 0x5B8B, 0x4F53, 0, 0 }; -static sal_Unicode const aNSimSun[] = { 0x65B0, 0x5B8B, 0x4F53, 0, 0 }; -static sal_Unicode const aSimHei[] = { 0x9ED1, 0x4F53, 0, 0 }; -static sal_Unicode const aSimKai[] = { 0x6977, 0x4F53, 0, 0 }; -static sal_Unicode const azycjkSun[] = { 0x4E2D, 0x6613, 0x5B8B, 0x4F53, 0, 0 }; -static sal_Unicode const azycjkHei[] = { 0x4E2D, 0x6613, 0x9ED1, 0x4F53, 0, 0 }; -static sal_Unicode const azycjkKai[] = { 0x4E2D, 0x6613, 0x6977, 0x4F53, 0, 0 }; -static sal_Unicode const aFZHei[] = { 0x65B9, 0x6B63, 0x9ED1, 0x4F53, 0, 0 }; -static sal_Unicode const aFZKai[] = { 0x65B9, 0x6B63, 0x6977, 0x4F53, 0, 0 }; -static sal_Unicode const aFZSongYI[] = { 0x65B9, 0x6B63, 0x5B8B, 0x4E00, 0, 0 }; -static sal_Unicode const aFZShuSong[] = { 0x65B9, 0x6B63, 0x4E66, 0x5B8B, 0, 0 }; -static sal_Unicode const aFZFangSong[] = { 0x65B9, 0x6B63, 0x4EFF, 0x5B8B, 0, 0 }; -// Attention: this fonts includes the wrong encoding vector - so we double the names with correct and wrong encoding -// First one is the GB-Encoding (we think the correct one), second is the big5 encoded name -static sal_Unicode const aMHei[] = { 'm', 0x7B80, 0x9ED1, 0, 'm', 0x6F60, 0x7AAA, 0, 0 }; -static sal_Unicode const aMKai[] = { 'm', 0x7B80, 0x6977, 0x566C, 0, 'm', 0x6F60, 0x7FF1, 0x628E, 0, 0 }; -static sal_Unicode const aMSong[] = { 'm', 0x7B80, 0x5B8B, 0, 'm', 0x6F60, 0x51BC, 0, 0 }; -static sal_Unicode const aCFangSong[] = { 'm', 0x7B80, 0x592B, 0x5B8B, 0, 'm', 0x6F60, 0x6E98, 0x51BC, 0, 0 }; -static sal_Unicode const aMingLiU[] = { 0x7D30, 0x660E, 0x9AD4, 0, 0 }; -static sal_Unicode const aPMingLiU[] = { 0x65B0, 0x7D30, 0x660E, 0x9AD4, 0, 0 }; -static sal_Unicode const aHei[] = { 0x6865, 0, 0 }; -static sal_Unicode const aKai[] = { 0x6B61, 0, 0 }; -static sal_Unicode const aMing[] = { 0x6D69, 0x6E67, 0, 0 }; -static sal_Unicode const aMSGothic[] = { 'm','s', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0, 0 }; -static sal_Unicode const aMSPGothic[] = { 'm','s','p', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0, 0 }; -static sal_Unicode const aMSMincho[] = { 'm', 's', 0x660E, 0x671D, 0 }; -static sal_Unicode const aMSPMincho[] = { 'm','s','p', 0x660E, 0x671D, 0 }; -static sal_Unicode const aMeiryo[] = { 0x30e1, 0x30a4, 0x30ea, 0x30aa, 0 }; -static sal_Unicode const aHGMinchoL[] = { 'h','g', 0x660E, 0x671D, 'l', 0, 0 }; -static sal_Unicode const aHGGothicB[] = { 'h','g', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 'b', 0 }; -static sal_Unicode const aHGPMinchoL[] = { 'h','g','p', 0x660E, 0x671D, 'l', 0 }; -static sal_Unicode const aHGPGothicB[] = { 'h','g','p', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 'b', 0 }; -static sal_Unicode const aHGMinchoLSun[] = { 'h','g', 0x660E, 0x671D, 'l', 's', 'u', 'n', 0 }; -static sal_Unicode const aHGPMinchoLSun[] = { 'h','g','p', 0x660E, 0x671D, 'l', 's', 'u', 'n', 0 }; -static sal_Unicode const aHGGothicBSun[] = { 'h', 'g', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 'b', 's', 'u', 'n', 0 }; -static sal_Unicode const aHGPGothicBSun[] = { 'h', 'g', 'p', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 'b', 's', 'u', 'n', 0 }; -static sal_Unicode const aHGHeiseiMin[] = { 'h', 'g', 0x5E73, 0x6210, 0x660E, 0x671D, 0x4F53, 0, 'h', 'g', 0x5E73, 0x6210, 0x660E, 0x671D, 0x4F53, 'w', '3', 'x', '1', '2', 0, 0 }; -static sal_Unicode const aIPAMincho[] = { 'i', 'p', 'a', 0x660E, 0x671D, 0 }; -static sal_Unicode const aIPAPMincho[] = { 'i', 'p', 'a', 'p', 0x660E, 0x671D, 0 }; -static sal_Unicode const aIPAGothic[] = { 'i', 'p', 'a', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0 }; -static sal_Unicode const aIPAPGothic[] = { 'i', 'p', 'a', 'p', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0 }; -static sal_Unicode const aIPAUIGothic[] = { 'i', 'p', 'a', 'u', 'i', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0 }; -static sal_Unicode const aSazanamiMincho[] = { 0x3055, 0x3056, 0x306A, 0x307F, 0x660E, 0x671D, 0, 0 }; -static sal_Unicode const aSazanamiGothic[] = { 0x3055, 0x3056, 0x306A, 0x307F, 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0, 0 }; -static sal_Unicode const aKochiMincho[] = { 0x6771, 0x98A8, 0x660E, 0x671D, 0, 0 }; -static sal_Unicode const aKochiGothic[] = { 0x6771, 0x98A8, 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0, 0 }; -static sal_Unicode const aSunDotum[] = { 0xC36C, 0xB3CB, 0xC6C0, 0, 0 }; -static sal_Unicode const aSunGulim[] = { 0xC36C, 0xAD74, 0xB9BC, 0, 0 }; -static sal_Unicode const aSunBatang[] = { 0xC36C, 0xBC14, 0xD0D5, 0, 0 }; -static sal_Unicode const aBaekmukDotum[] = { 0xBC31, 0xBB35, 0xB3CB, 0xC6C0, 0, 0 }; -static sal_Unicode const aBaekmukGulim[] = { 0xBC31, 0xBB35, 0xAD74, 0xB9BC, 0, 0 }; -static sal_Unicode const aBaekmukBatang[] = { 0xBC31, 0xBB35, 0xBC14, 0xD0D5, 0, 0 }; -static sal_Unicode const aFzMingTi[] = { 0x65B9, 0x6B63, 0x660E, 0x9AD4, 0, 0 }; -static sal_Unicode const aFzHeiTiTW[]= { 0x65B9, 0x6B63, 0x9ED1, 0x9AD4, 0, 0 }; -static sal_Unicode const aFzKaiTiTW[]= { 0x65B9, 0x6B63, 0x6977, 0x9AD4, 0, 0 }; -static sal_Unicode const aFzHeiTiCN[]= { 0x65B9, 0x6B63, 0x9ED1, 0x4F53, 0, 0 }; -static sal_Unicode const aFzKaiTiCN[]= { 0x65B9, 0x6B63, 0x6977, 0x4F53, 0, 0 }; -static sal_Unicode const aFzSongTi[] = { 0x65B9, 0x6B63, 0x5B8B, 0x4F53, 0, 0 }; -static sal_Unicode const aHYMyeongJoExtra[] = { 'h', 'y', 0xACAC, 0xBA85, 0xC870, 0, 0 }; -static sal_Unicode const aHYSinMyeongJoMedium[] = { 'h', 'y', 0xC2E0, 0xBA85, 0xC870, 0, 0 }; -static sal_Unicode const aHYGothicMedium[] = { 'h', 'y', 0xC911, 0xACE0, 0xB515, 0, 0 }; -static sal_Unicode const aHYGraphicMedium[] = { 'h', 'y', 0xADF8, 0xB798, 0xD53D, 'm', 0, 0 }; -static sal_Unicode const aHYGraphic[] = { 'h', 'y', 0xADF8, 0xB798, 0xD53D, 0, 0 }; -static sal_Unicode const aNewGulim[] = { 0xC0C8, 0xAD74, 0xB9BC, 0, 0 }; -static sal_Unicode const aSunGungseo[] = { 0xC36C, 0xAD81, 0xC11C, 0, 0 }; -static sal_Unicode const aHYGungSoBold[] = { 'h','y', 0xAD81, 0xC11C, 'b', 0, 0 }; -static sal_Unicode const aHYGungSo[] = { 'h','y', 0xAD81, 0xC11C, 0, 0 }; -static sal_Unicode const aSunHeadLine[] = { 0xC36C, 0xD5E4, 0xB4DC, 0xB77C, 0xC778, 0, 0 }; -static sal_Unicode const aHYHeadLineMedium[] = { 'h', 'y', 0xD5E4, 0xB4DC, 0xB77C, 0xC778, 'm', 0, 0 }; -static sal_Unicode const aHYHeadLine[] = { 'h', 'y', 0xD5E4, 0xB4DC, 0xB77C, 0xC778, 0, 0 }; -static sal_Unicode const aYetR[] = { 0xD734, 0xBA3C, 0xC61B, 0xCCB4, 0, 0 }; -static sal_Unicode const aHYGothicExtra[] = { 'h', 'y', 0xACAC, 0xACE0, 0xB515, 0, 0 }; -static sal_Unicode const aSunMokPan[] = { 0xC36C, 0xBAA9, 0xD310, 0, 0 }; -static sal_Unicode const aSunYeopseo[] = { 0xC36C, 0xC5FD, 0xC11C, 0, 0 }; -static sal_Unicode const aSunBaekSong[] = { 0xC36C, 0xBC31, 0xC1A1, 0, 0 }; -static sal_Unicode const aHYPostLight[] = { 'h', 'y', 0xC5FD, 0xC11C, 'l', 0, 0 }; -static sal_Unicode const aHYPost[] = { 'h', 'y', 0xC5FD, 0xC11C, 0, 0 }; -static sal_Unicode const aMagicR[] = { 0xD734, 0xBA3C, 0xB9E4, 0xC9C1, 0xCCB4, 0, 0 }; -static sal_Unicode const aSunCrystal[] = { 0xC36C, 0xD06C, 0xB9AC, 0xC2A4, 0xD0C8, 0, 0 }; -static sal_Unicode const aSunSaemmul[] = { 0xC36C, 0xC0D8, 0xBB3C, 0, 0 }; -static sal_Unicode const aHaansoftBatang[] = { 0xD55C, 0xCEF4, 0xBC14, 0xD0D5, 0, 0 }; -static sal_Unicode const aHaansoftDotum[] = { 0xD55C, 0xCEF4, 0xB3CB, 0xC6C0, 0, 0 }; -static sal_Unicode const aHyhaeseo[] = { 0xD55C, 0xC591, 0xD574, 0xC11C, 0, 0 }; -static sal_Unicode const aMDSol[] = { 'm', 'd', 0xC194, 0xCCB4, 0, 0 }; -static sal_Unicode const aMDGaesung[] = { 'm', 'd', 0xAC1C, 0xC131, 0xCCB4, 0, 0 }; -static sal_Unicode const aMDArt[] = { 'm', 'd', 0xC544, 0xD2B8, 0xCCB4, 0, 0 }; -static sal_Unicode const aMDAlong[] = { 'm', 'd', 0xC544, 0xB871, 0xCCB4, 0, 0 }; -static sal_Unicode const aMDEasop[] = { 'm', 'd', 0xC774, 0xC19D, 0xCCB4, 0, 0 }; -static sal_Unicode const aHYShortSamulMedium[] = { 'h', 'y', 0xC595, 0xC740, 0xC0D8, 0xBB3C, 'm', 0 }; -static sal_Unicode const aHYShortSamul[] = { 'h', 'y', 0xC595, 0xC740, 0xC0D8, 0xBB3C, 0 }; -static sal_Unicode const aHGGothicE[] = { 'h','g', 0xFF7A, 0xFF9E, 0xFF7C, 0xFF6F, 0xFF78, 'e', 0 }; -static sal_Unicode const aHGPGothicE[] = { 'h','g','p', 0xFF7A, 0xFF9E, 0xFF7C, 0xFF6F, 0xFF78, 'e', 0 }; -static sal_Unicode const aHGSGothicE[] = { 'h','g','s', 0xFF7A, 0xFF9E, 0xFF7C, 0xFF6F, 0xFF78, 'e', 0 }; -static sal_Unicode const aHGGothicM[] = { 'h','g', 0xFF7A, 0xFF9E, 0xFF7C, 0xFF6F, 0xFF78, 'm', 0 }; -static sal_Unicode const aHGPGothicM[] = { 'h','g','p', 0xFF7A, 0xFF9E, 0xFF7C, 0xFF6F, 0xFF78, 'm', 0 }; -static sal_Unicode const aHGSGothicM[] = { 'h','g','s', 0xFF7A, 0xFF9E, 0xFF7C, 0xFF6F, 0xFF78, 'm', 0 }; -static sal_Unicode const aHGGyoshotai[] = { 'h','g', 0x884C, 0x66F8, 0x4F53, 0 }; -static sal_Unicode const aHGPGyoshotai[] = { 'h','g','p', 0x884C, 0x66F8, 0x4F53, 0 }; -static sal_Unicode const aHGSGyoshotai[] = { 'h','g','s', 0x884C, 0x66F8, 0x4F53, 0 }; -static sal_Unicode const aHGKyokashotai[] = { 'h','g', 0x6559, 0x79D1, 0x66F8, 0x4F53, 0 }; -static sal_Unicode const aHGPKyokashotai[] = { 'h','g','p', 0x6559, 0x79D1, 0x66F8, 0x4F53, 0 }; -static sal_Unicode const aHGSKyokashotai[] = { 'h','g','s', 0x6559, 0x79D1, 0x66F8, 0x4F53, 0 }; -static sal_Unicode const aHGMinchoB[] = { 'h','g', 0x660E, 0x671D, 'b', 0 }; -static sal_Unicode const aHGPMinchoB[] = { 'h','g','p', 0x660E, 0x671D, 'b', 0 }; -static sal_Unicode const aHGSMinchoB[] = { 'h','g','s', 0x660E, 0x671D, 'b', 0 }; -static sal_Unicode const aHGMinchoE[] = { 'h','g', 0x660E, 0x671D, 'e', 0 }; -static sal_Unicode const aHGPMinchoE[] = { 'h','g','p', 0x660E, 0x671D, 'e', 0 }; -static sal_Unicode const aHGSMinchoE[] = { 'h','g','s', 0x660E, 0x671D, 'e', 0 }; -static sal_Unicode const aHGSoeiKakupoptai[] = { 'h','g', 0x5275,0x82F1,0x89D2,0xFF8E, - 0xFF9F,0xFF6F,0xFF8C,0xFF9F,0x4F53,0}; -static sal_Unicode const aHGPSoeiKakupoptai[] = { 'h','g', 'p', 0x5275,0x82F1,0x89D2,0xFF8E, - 0xFF9F,0xFF6F,0xFF8C,0xFF9F,0x4F53,0}; -static sal_Unicode const aHGSSoeiKakupoptai[] = { 'h','g', 's', 0x5275,0x82F1,0x89D2,0xFF8E, - 0xFF9F,0xFF6F,0xFF8C,0xFF9F,0x4F53,0}; -static sal_Unicode const aHGSoeiPresenceEB[] = { 'h','g', 0x5275,0x82F1,0xFF8C,0xFF9F, - 0xFF9A,0xFF7E,0xFF9E,0xFF9D,0xFF7D, 'e','b',0}; -static sal_Unicode const aHGPSoeiPresenceEB[] = { 'h','g','p', 0x5275,0x82F1,0xFF8C,0xFF9F, - 0xFF9A,0xFF7E,0xFF9E,0xFF9D,0xFF7D, 'e','b',0}; -static sal_Unicode const aHGSSoeiPresenceEB[] = { 'h','g','s', 0x5275,0x82F1,0xFF8C,0xFF9F, - 0xFF9A,0xFF7E,0xFF9E,0xFF9D,0xFF7D, 'e','b',0}; -static sal_Unicode const aHGSoeiKakugothicUB[] = { 'h','g', 0x5275,0x82F1,0x89D2,0xFF7A, - 0xFF9E,0xFF7C,0xFF6F,0xFF78,'u','b',0}; -static sal_Unicode const aHGPSoeiKakugothicUB[] = { 'h','g','p', 0x5275,0x82F1,0x89D2,0xFF7A, - 0xFF9E,0xFF7C,0xFF6F,0xFF78,'u','b',0}; -static sal_Unicode const aHGSSoeiKakugothicUB[] = { 'h','g','s', 0x5275,0x82F1,0x89D2,0xFF7A, - 0xFF9E,0xFF7C,0xFF6F,0xFF78,'u','b',0}; -static sal_Unicode const aHGSeikaishotaiPRO[] = { 'h','g', 0x6B63,0x6977,0x66F8,0x4F53, '-','p','r','o',0}; -static sal_Unicode const aHGMaruGothicMPRO[] = { 'h','g', 0x4E38,0xFF7A,0xFF9E,0xFF7C,0xFF6F,0xFF78, '-','p','r','o',0}; -static sal_Unicode const aHiraginoMinchoPro[] = { 0x30D2, 0x30E9, 0x30AE, 0x30CE, 0x660E, 0x671D, 'p','r','o',0}; -static sal_Unicode const aHiraginoMinchoProN[] = { 0x30D2, 0x30E9, 0x30AE, 0x30CE, 0x660E, 0x671D, 'p','r','o','n',0}; -static sal_Unicode const aHiraginoKakuGothicPro[] = { 0x30D2, 0x30E9, 0x30AE, 0x30CE, 0x89D2, 0x30B4, 'p','r','o',0}; -static sal_Unicode const aHiraginoKakuGothicProN[] = { 0x30D2, 0x30E9, 0x30AE, 0x30CE, 0x89D2, 0x30B4, 'p','r','o','n',0}; -static sal_Unicode const aHiraginoMaruGothicPro[] = { 0x30D2, 0x30E9, 0x30AE, 0x30CE, 0x4E38, 0x30B4, 'p','r','o',0}; -static sal_Unicode const aHiraginoMaruGothicProN[] = { 0x30D2, 0x30E9, 0x30AE, 0x30CE, 0x4E38, 0x30B4, 'p','r','o','n',0}; - - -static ImplLocalizedFontName aImplLocalizedNamesList[] = -{ -{ "batang", aBatang }, -{ "batangche", aBatangChe }, -{ "gungshu", aGungsuh }, -{ "gungshuche", aGungsuhChe }, -{ "gulim", aGulim }, -{ "gulimche", aGulimChe }, -{ "dotum", aDotum }, -{ "dotumche", aDotumChe }, -{ "simsun", aSimSun }, -{ "nsimsun", aNSimSun }, -{ "simhei", aSimHei }, -{ "simkai", aSimKai }, -{ "zycjksun", azycjkSun }, -{ "zycjkhei", azycjkHei }, -{ "zycjkkai", azycjkKai }, -{ "fzhei", aFZHei }, -{ "fzkai", aFZKai }, -{ "fzsong", aFZSongYI }, -{ "fzshusong", aFZShuSong }, -{ "fzfangsong", aFZFangSong }, -{ "mhei", aMHei }, -{ "mkai", aMKai }, -{ "msong", aMSong }, -{ "cfangsong", aCFangSong }, -{ "mingliu", aMingLiU }, -{ "pmingliu", aPMingLiU }, -{ "hei", aHei }, -{ "kai", aKai }, -{ "ming", aMing }, -{ "msgothic", aMSGothic }, -{ "mspgothic", aMSPGothic }, -{ "msmincho", aMSMincho }, -{ "mspmincho", aMSPMincho }, -{ "meiryo", aMeiryo }, -{ "hgminchol", aHGMinchoL }, -{ "hggothicb", aHGGothicB }, -{ "hgpminchol", aHGPMinchoL }, -{ "hgpgothicb", aHGPGothicB }, -{ "hgmincholsun", aHGMinchoLSun }, -{ "hggothicbsun", aHGGothicBSun }, -{ "hgpmincholsun", aHGPMinchoLSun }, -{ "hgpgothicbsun", aHGPGothicBSun }, -{ "hgheiseimin", aHGHeiseiMin }, -{ "ipamincho", aIPAMincho }, -{ "ipapmincho", aIPAPMincho }, -{ "ipagothic", aIPAGothic }, -{ "ipapgothic", aIPAPGothic }, -{ "ipauigothic", aIPAUIGothic }, -{ "sazanamimincho", aSazanamiMincho }, -{ "sazanamigothic", aSazanamiGothic }, -{ "kochimincho", aKochiMincho }, -{ "kochigothic", aKochiGothic }, -{ "sundotum", aSunDotum }, -{ "sungulim", aSunGulim }, -{ "sunbatang", aSunBatang }, -{ "baekmukdotum", aBaekmukDotum }, -{ "baekmukgulim", aBaekmukGulim }, -{ "baekmukbatang", aBaekmukBatang }, -{ "fzheiti", aFzHeiTiCN }, -{ "fzheiti", aFzHeiTiTW }, -{ "fzkaiti", aFzKaiTiCN }, -{ "fzkaitib", aFzKaiTiTW }, -{ "fzmingtib", aFzMingTi }, -{ "fzsongti", aFzSongTi }, -{ "hymyeongjoextra", aHYMyeongJoExtra }, -{ "hysinmyeongjomedium", aHYSinMyeongJoMedium }, -{ "hygothicmedium", aHYGothicMedium }, -{ "hygraphicmedium", aHYGraphicMedium }, -{ "hygraphic", aHYGraphic }, -{ "newgulim", aNewGulim }, -{ "sungungseo", aSunGungseo }, -{ "hygungsobold", aHYGungSoBold }, -{ "hygungso", aHYGungSo }, -{ "sunheadline", aSunHeadLine }, -{ "hyheadlinemedium", aHYHeadLineMedium }, -{ "hyheadline", aHYHeadLine }, -{ "yetr", aYetR }, -{ "hygothicextra", aHYGothicExtra }, -{ "sunmokpan", aSunMokPan }, -{ "sunyeopseo", aSunYeopseo }, -{ "sunbaeksong", aSunBaekSong }, -{ "hypostlight", aHYPostLight }, -{ "hypost", aHYPost }, -{ "magicr", aMagicR }, -{ "suncrystal", aSunCrystal }, -{ "sunsaemmul", aSunSaemmul }, -{ "hyshortsamulmedium", aHYShortSamulMedium }, -{ "hyshortsamul", aHYShortSamul }, -{ "haansoftbatang", aHaansoftBatang }, -{ "haansoftdotum", aHaansoftDotum }, -{ "hyhaeseo", aHyhaeseo }, -{ "mdsol", aMDSol }, -{ "mdgaesung", aMDGaesung }, -{ "mdart", aMDArt }, -{ "mdalong", aMDAlong }, -{ "mdeasop", aMDEasop }, -{ "hggothice", aHGGothicE }, -{ "hgpgothice", aHGPGothicE }, -{ "hgpothice", aHGSGothicE }, -{ "hggothicm", aHGGothicM }, -{ "hgpgothicm", aHGPGothicM }, -{ "hgpgothicm", aHGSGothicM }, -{ "hggyoshotai", aHGGyoshotai }, -{ "hgpgyoshotai", aHGPGyoshotai }, -{ "hgsgyoshotai", aHGSGyoshotai }, -{ "hgkyokashotai", aHGKyokashotai }, -{ "hgpkyokashotai", aHGPKyokashotai }, -{ "hgskyokashotai", aHGSKyokashotai }, -{ "hgminchob", aHGMinchoB }, -{ "hgpminchob", aHGPMinchoB }, -{ "hgsminchob", aHGSMinchoB }, -{ "hgminchoe", aHGMinchoE }, -{ "hgpminchoe", aHGPMinchoE }, -{ "hgsminchoe", aHGSMinchoE }, -{ "hgsoeikakupoptai", aHGSoeiKakupoptai }, -{ "hgpsoeikakupopta", aHGPSoeiKakupoptai }, -{ "hgssoeikakupopta", aHGSSoeiKakupoptai }, -{ "hgsoeipresenceeb", aHGSoeiPresenceEB }, -{ "hgpsoeipresenceeb", aHGPSoeiPresenceEB }, -{ "hgssoeipresenceeb", aHGSSoeiPresenceEB }, -{ "hgsoeikakugothicub", aHGSoeiKakugothicUB }, -{ "hgpsoeikakugothicub", aHGPSoeiKakugothicUB }, -{ "hgssoeikakugothicub", aHGSSoeiKakugothicUB }, -{ "hgseikaishotaipro", aHGSeikaishotaiPRO }, -{ "hgmarugothicmpro", aHGMaruGothicMPRO }, -{ "hiraginominchopro", aHiraginoMinchoPro }, -{ "hiraginominchopron", aHiraginoMinchoProN }, -{ "hiraginokakugothicpro", aHiraginoKakuGothicPro }, -{ "hiraginokakugothicpron", aHiraginoKakuGothicProN }, -{ "hiraginomarugothicpro", aHiraginoMaruGothicPro }, -{ "hiraginomarugothicpron", aHiraginoMaruGothicProN }, -{ NULL, NULL }, -}; - -// ----------------------------------------------------------------------- - -void ImplGetEnglishSearchFontName( String& rName ) -{ - bool bNeedTranslation = false; - xub_StrLen nLen = rName.Len(); - - // Remove trailing whitespaces - xub_StrLen i = nLen; - while ( i && (rName.GetChar( i-1 ) < 32) ) - i--; - if ( i != nLen ) - rName.Erase( i ); - - // Remove Script at the end - // Scriptname must be the last part of the fontname and - // looks like "fontname (scriptname)". So there can only be a - // script name at the and of the fontname, when the last char is ')' - if ( (nLen >= 3) && rName.GetChar( nLen-1 ) == ')' ) - { - int nOpen = 1; - xub_StrLen nTempLen = nLen-2; - while ( nTempLen ) - { - if ( rName.GetChar( nTempLen ) == '(' ) - { - nOpen--; - if ( !nOpen ) - { - // Remove Space at the end - if ( nTempLen && (rName.GetChar( nTempLen-1 ) == ' ') ) - nTempLen--; - rName.Erase( nTempLen ); - nLen = nTempLen; - break; - } - } - if ( rName.GetChar( nTempLen ) == ')' ) - nOpen++; - nTempLen--; - } - } - - // remove all whitespaces and converts to lower case ASCII - // TODO: better transliteration to ASCII e.g. all digits - i = 0; - while ( i < nLen ) - { - sal_Unicode c = rName.GetChar( i ); - if ( c > 127 ) - { - // Translate to Lowercase-ASCII - // FullWidth-ASCII to half ASCII - if ( (c >= 0xFF00) && (c <= 0xFF5E) ) - { - c -= 0xFF00-0x0020; - // Upper to Lower - if ( (c >= 'A') && (c <= 'Z') ) - c += 'a' - 'A'; - rName.SetChar( i, c ); - } - else - { - // Only Fontnames with None-Ascii-Characters must be translated - bNeedTranslation = true; - } - } - // not lowercase Ascii - else if ( !((c >= 'a') && (c <= 'z')) ) - { - // To Lowercase-Ascii - if ( (c >= 'A') && (c <= 'Z') ) - { - c += 'a' - 'A'; - rName.SetChar( i, c ); - } - else if( ((c < '0') || (c > '9')) && (c != ';') ) // not 0-9 or semicolon - { - // Remove white spaces and special characters - rName.Erase( i, 1 ); - nLen--; - continue; - } - } - - i++; - } - - // translate normalized localized name to its normalized English ASCII name - if( bNeedTranslation ) - { - typedef std::hash_map<const String, const char*,FontNameHash> FontNameDictionary; - static FontNameDictionary aDictionary( sizeof(aImplLocalizedNamesList) / sizeof(*aImplLocalizedNamesList) ); - // the font name dictionary needs to be intialized once - if( aDictionary.empty() ) - { - // TODO: check if all dictionary entries are already normalized? - const ImplLocalizedFontName* pList = aImplLocalizedNamesList; - for(; pList->mpEnglishName; ++pList ) - aDictionary[ pList->mpLocalizedNames ] = pList->mpEnglishName; - } - - FontNameDictionary::const_iterator it = aDictionary.find( rName ); - if( it != aDictionary.end() ) - rName.AssignAscii( it->second ); - } -} - -// ----------------------------------------------------------------------- - -static String GetNextFontToken( const String& rTokenStr, xub_StrLen& rIndex ) -{ - // check for valid start index - int nStringLen = rTokenStr.Len(); - if( rIndex >= nStringLen ) - { - rIndex = STRING_NOTFOUND; - return String(); - } - - // find the next token delimiter and return the token substring - const sal_Unicode* pStr = rTokenStr.GetBuffer() + rIndex; - const sal_Unicode* pEnd = rTokenStr.GetBuffer() + nStringLen; - for(; pStr < pEnd; ++pStr ) - if( (*pStr == ';') || (*pStr == ',') ) - break; - - xub_StrLen nTokenStart = rIndex; - xub_StrLen nTokenLen; - if( pStr < pEnd ) - { - rIndex = sal::static_int_cast<xub_StrLen>(pStr - rTokenStr.GetBuffer()); - nTokenLen = rIndex - nTokenStart; - ++rIndex; // skip over token separator - } - else - { - // no token delimiter found => handle last token - rIndex = STRING_NOTFOUND; - nTokenLen = STRING_LEN; - - // optimize if the token string consists of just one token - if( !nTokenStart ) - return rTokenStr; - } - - return String( rTokenStr, nTokenStart, nTokenLen ); -} - -// TODO: get rid of this in another incompatible build with SW project. -// SW's WW8 and RTF filters still use this (from fontcvt.hxx) -String GetFontToken( const String& rTokenStr, xub_StrLen nToken, xub_StrLen& rIndex ) -{ - // skip nToken Tokens - for( xub_StrLen i = 0; (i < nToken) && (rIndex != STRING_NOTFOUND); ++i ) - GetNextFontToken( rTokenStr, rIndex ); - - return GetNextFontToken( rTokenStr, rIndex ); -} // ======================================================================= @@ -813,8 +370,8 @@ ImplFontSubstEntry::ImplFontSubstEntry( const String& rFontName, { maSearchName = rFontName; maSearchReplaceName = rSubstFontName; - ImplGetEnglishSearchFontName( maSearchName ); - ImplGetEnglishSearchFontName( maSearchReplaceName ); + GetEnglishSearchFontName( maSearchName ); + GetEnglishSearchFontName( maSearchReplaceName ); } // ----------------------------------------------------------------------- @@ -914,7 +471,7 @@ static void ImplFontSubstitute( String& rFontName, { #ifdef DBG_UTIL String aTempName = rFontName; - ImplGetEnglishSearchFontName( aTempName ); + GetEnglishSearchFontName( aTempName ); DBG_ASSERT( aTempName == rFontName, "ImplFontSubstitute() called without a searchname" ); #endif @@ -939,44 +496,6 @@ static void ImplFontSubstitute( String& rFontName, } } -// ======================================================================= - -static bool ImplIsFontToken( const String& rName, const String& rToken ) -{ - String aTempName; - xub_StrLen nIndex = 0; - do - { - aTempName = GetNextFontToken( rName, nIndex ); - if ( rToken == aTempName ) - return true; - } - while ( nIndex != STRING_NOTFOUND ); - - return false; -} - -// ----------------------------------------------------------------------- - -static void ImplAppendFontToken( String& rName, const String& rNewToken ) -{ - if ( rName.Len() ) - { - rName.Append( ';' ); - rName.Append( rNewToken ); - } - else - rName = rNewToken; -} - -// ----------------------------------------------------------------------- - -static void ImplAddTokenFontName( String& rName, const String& rNewToken ) -{ - if ( !ImplIsFontToken( rName, rNewToken ) ) - ImplAppendFontToken( rName, rNewToken ); -} - // ----------------------------------------------------------------------- Font OutputDevice::GetDefaultFont( USHORT nType, LanguageType eLang, @@ -994,7 +513,7 @@ Font OutputDevice::GetDefaultFont( USHORT nType, LanguageType eLang, MsLangId::convertLanguageToLocale( eLang, aLocale ); } - DefaultFontConfiguration& rDefaults = *DefaultFontConfiguration::get(); + utl::DefaultFontConfiguration& rDefaults = *utl::DefaultFontConfiguration::get(); String aSearch = rDefaults.getUserInterfaceFont( aLocale ); // ensure a fallback String aDefault = rDefaults.getDefaultFont( aLocale, nType ); if( aDefault.Len() ) @@ -1073,11 +592,11 @@ Font OutputDevice::GetDefaultFont( USHORT nType, LanguageType eLang, do { aSearchName = GetNextFontToken( aSearch, nIndex ); - ImplGetEnglishSearchFontName( aSearchName ); + GetEnglishSearchFontName( aSearchName ); ImplDevFontListData* pFontFamily = pOutDev->mpFontList->ImplFindBySearchName( aSearchName ); if( pFontFamily ) { - ImplAddTokenFontName( aName, pFontFamily->GetFamilyName() ); + AddTokenFontName( aName, pFontFamily->GetFamilyName() ); if( nFlags & DEFAULTFONT_FLAGS_ONLYONE ) break; } @@ -1177,61 +696,6 @@ Font OutputDevice::GetDefaultFont( USHORT nType, LanguageType eLang, // ======================================================================= -String GetSubsFontName( const String& rName, ULONG nFlags ) -{ - String aName; - - xub_StrLen nIndex = 0; - String aOrgName = GetNextFontToken( rName, nIndex ); - ImplGetEnglishSearchFontName( aOrgName ); - - // #93662# do not try to replace StarSymbol with MS only font - if( nFlags == (SUBSFONT_MS|SUBSFONT_ONLYONE) - && ( aOrgName.EqualsAscii( "starsymbol" ) - || aOrgName.EqualsAscii( "opensymbol" ) ) ) - return aName; - - const FontNameAttr* pAttr = FontSubstConfiguration::get()->getSubstInfo( aOrgName ); - if ( pAttr ) - { - for( int i = 0; i < 3; i++ ) - { - const ::std::vector< String >* pVector = NULL; - switch( i ) - { - case 0: - if( nFlags & SUBSFONT_MS && pAttr->MSSubstitutions.size() ) - pVector = &pAttr->MSSubstitutions; - break; - case 1: - if( nFlags & SUBSFONT_PS && pAttr->PSSubstitutions.size() ) - pVector = &pAttr->PSSubstitutions; - break; - case 2: - if( nFlags & SUBSFONT_HTML && pAttr->HTMLSubstitutions.size() ) - pVector = &pAttr->HTMLSubstitutions; - break; - } - if( ! pVector ) - continue; - for( ::std::vector< String >::const_iterator it = pVector->begin(); it != pVector->end(); ++it ) - if( ! ImplIsFontToken( rName, *it ) ) - { - ImplAppendFontToken( aName, *it ); - if( nFlags & SUBSFONT_ONLYONE ) - { - i = 4; - break; - } - } - } - } - - return aName; -} - -// ======================================================================= - static unsigned ImplIsCJKFont( const String& rFontName ) { // Test, if Fontname includes CJK characters --> In this case we @@ -1696,7 +1160,7 @@ bool ImplDevFontListData::AddFontFace( ImplFontData* pNewData ) // ----------------------------------------------------------------------- // get font attributes using the normalized font family name -void ImplDevFontListData::InitMatchData( const vcl::FontSubstConfiguration& rFontSubst, +void ImplDevFontListData::InitMatchData( const utl::FontSubstConfiguration& rFontSubst, const String& rSearchName ) { String aShortName; @@ -1835,29 +1299,6 @@ void ImplDevFontList::Clear() mbMatchData = false; } -// ----------------------------------------------------------------------- - -// TODO: use a more generic String hash -int FontNameHash::operator()( const String& rStr ) const -{ - // this simple hash just has to be good enough for font names - int nHash = 0; - const int nLen = rStr.Len(); - const sal_Unicode* p = rStr.GetBuffer(); - switch( nLen ) - { - default: nHash = (p[0]<<16) - (p[1]<<8) + p[2]; - nHash += nLen; - p += nLen - 3; - // fall through - case 3: nHash += (p[2]<<16); // fall through - case 2: nHash += (p[1]<<8); // fall through - case 1: nHash += p[0]; // fall through - case 0: break; - }; - - return nHash; -} // ----------------------------------------------------------------------- @@ -2004,7 +1445,7 @@ ImplDevFontListData* ImplDevFontList::GetGlyphFallbackFont( ImplFontSelectData& // call the hook to query the best matching glyph fallback font if( mpFallbackHook->FindFontSubstitute( rFontSelData, rMissingCodes ) ) // apply outdev3.cxx specific fontname normalization - ImplGetEnglishSearchFontName( rFontSelData.maSearchName ); + GetEnglishSearchFontName( rFontSelData.maSearchName ); else rFontSelData.maSearchName = String(); @@ -2059,7 +1500,7 @@ void ImplDevFontList::Add( ImplFontData* pNewData ) for( xub_StrLen nMapNameIndex = 0; nMapNameIndex != STRING_NOTFOUND; ) { String aSearchName = pNewData->maName; - ImplGetEnglishSearchFontName( aSearchName ); + GetEnglishSearchFontName( aSearchName ); DevFontList::const_iterator it = maDevFontList.find( aSearchName ); ImplDevFontListData* pFoundData = NULL; @@ -2096,7 +1537,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindBySearchName( const String& rSearc { #ifdef DEBUG String aTempName = rSearchName; - ImplGetEnglishSearchFontName( aTempName ); + GetEnglishSearchFontName( aTempName ); DBG_ASSERT( aTempName == rSearchName, "ImplDevFontList::ImplFindBySearchName() called with non-normalized name" ); #endif @@ -2151,7 +1592,7 @@ ImplDevFontListData* ImplDevFontList::FindFontFamily( const String& rFontName ) { // normalize the font fomily name and String aName = rFontName; - ImplGetEnglishSearchFontName( aName ); + GetEnglishSearchFontName( aName ); ImplDevFontListData* pFound = ImplFindBySearchName( aName ); return pFound; } @@ -2168,7 +1609,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByTokenNames( const String& rToken String aSearchName = GetNextFontToken( rTokenStr, nTokenPos ); if( !aSearchName.Len() ) continue; - ImplGetEnglishSearchFontName( aSearchName ); + GetEnglishSearchFontName( aSearchName ); pFoundData = ImplFindBySearchName( aSearchName ); if( pFoundData ) break; @@ -2179,7 +1620,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByTokenNames( const String& rToken // ----------------------------------------------------------------------- -ImplDevFontListData* ImplDevFontList::ImplFindBySubstFontAttr( const vcl::FontNameAttr& rFontAttr ) const +ImplDevFontListData* ImplDevFontList::ImplFindBySubstFontAttr( const utl::FontNameAttr& rFontAttr ) const { ImplDevFontListData* pFoundData = NULL; @@ -2188,7 +1629,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindBySubstFontAttr( const vcl::FontNa for(; it != rFontAttr.Substitutions.end(); ++it ) { String aSearchName( *it ); - ImplGetEnglishSearchFontName( aSearchName ); + GetEnglishSearchFontName( aSearchName ); pFoundData = ImplFindBySearchName( aSearchName ); if( pFoundData ) @@ -2934,7 +2375,7 @@ ImplFontEntry* ImplFontCache::GetFontEntry( ImplDevFontList* pFontList, // if we found a different symbol font we need a symbol conversion table if( pFontData->IsSymbolFont() ) if( aFontSelData.maTargetName != aFontSelData.maSearchName ) - pEntry->mpConversion = ImplGetRecodeData( aFontSelData.maTargetName, aFontSelData.maSearchName ); + pEntry->mpConversion = ConvertChar::GetRecodeData( aFontSelData.maTargetName, aFontSelData.maSearchName ); // add the new entry to the cache maFontInstanceList[ aFontSelData ] = pEntry; @@ -2982,7 +2423,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( ImplFontSelectData& rFSD, #endif - ImplGetEnglishSearchFontName( aSearchName ); + GetEnglishSearchFontName( aSearchName ); ImplFontSubstitute( aSearchName, nSubstFlags, pDevSpecific ); // #114999# special emboldening for Ricoh fonts // TODO: smarter check for special cases by using PreMatch infrastructure? @@ -3030,7 +2471,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( ImplFontSelectData& rFSD, #endif if( mpPreMatchHook ) if( mpPreMatchHook->FindFontSubstitute( rFSD ) ) - ImplGetEnglishSearchFontName( aSearchName ); + GetEnglishSearchFontName( aSearchName ); #ifdef ENABLE_GRAPHITE // the prematch hook uses the target name to search, but we now need // to restore the features to make the font selection data unique @@ -3057,13 +2498,13 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( ImplFontSelectData& rFSD, { rFSD.maTargetName = GetNextFontToken( rFSD.maName, nTokenPos ); aSearchName = rFSD.maTargetName; - ImplGetEnglishSearchFontName( aSearchName ); + GetEnglishSearchFontName( aSearchName ); } else nTokenPos = STRING_NOTFOUND; if( mpPreMatchHook ) if( mpPreMatchHook->FindFontSubstitute( rFSD ) ) - ImplGetEnglishSearchFontName( aSearchName ); + GetEnglishSearchFontName( aSearchName ); ImplFontSubstitute( aSearchName, nSubstFlags, pDevSpecific ); ImplDevFontListData* pFoundData = ImplFindBySearchName( aSearchName ); if( pFoundData ) @@ -3077,7 +2518,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( ImplFontSelectData& rFSD, nTokenPos = 0; rFSD.maTargetName = GetNextFontToken( rFSD.maName, nTokenPos ); aSearchName = rFSD.maTargetName; - ImplGetEnglishSearchFontName( aSearchName ); + GetEnglishSearchFontName( aSearchName ); } String aSearchShortName; @@ -3152,7 +2593,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( ImplFontSelectData& rFSD, continue; aSearchName = rFSD.maTargetName; - ImplGetEnglishSearchFontName( aSearchName ); + GetEnglishSearchFontName( aSearchName ); String aTempShortName; String aTempFamilyName; @@ -6488,7 +5929,7 @@ SalLayout* OutputDevice::ImplLayout( const String& rOrigStr, // convert from logical units to physical units // recode string if needed if( mpFontEntry->mpConversion ) - ImplRecodeString( mpFontEntry->mpConversion, aStr, 0, aStr.Len() ); + mpFontEntry->mpConversion->RecodeString( aStr, 0, aStr.Len() ); long nPixelWidth = nLogicalWidth; if( nLogicalWidth && mbMap ) |