added fine tuning for font matching.

This commit is contained in:
rachytski 2011-02-02 01:46:48 +02:00 committed by Alex Zolotarev
parent 0eb1867042
commit 116019f522
21 changed files with 352 additions and 80 deletions

View file

@ -18,6 +18,7 @@ SOURCES += \
commands_queue.cpp \
shared_buffer_manager.cpp \
memory_mapped_file.cpp \
path_utils.cpp
HEADERS += \
SRC_FIRST.hpp \
@ -59,3 +60,4 @@ HEADERS += \
shared_buffer_manager.hpp \
memory_mapped_file.hpp \
buffer_vector.hpp \
path_utils.hpp

12
base/path_utils.cpp Normal file
View file

@ -0,0 +1,12 @@
#include "../base/SRC_FIRST.hpp"
#include "path_utils.hpp"
#include "string_utils.hpp"
string const extract_folder(string const & fileName)
{
}
string const extract_name(string const & fileName)
{
return fileName.substr(fileName.find_last_of("\\/") + 1, fileName.size());
}

8
base/path_utils.hpp Normal file
View file

@ -0,0 +1,8 @@
#pragma once
#include "../std/string.hpp"
/// extract folder name from full path. ended with path delimiter
string const extract_folder(string const & fileName);
/// extract file name from full path.
string const extract_name(string const & fileName);

7
data/fonts_blacklist.txt Normal file
View file

@ -0,0 +1,7 @@
* Apple_Braille_Outline_6_Dot.ttf
* Apple_Braille_Outline_8_Dot.ttf
* Apple_Braille_Pinpoint_6_Dot.ttf
* Apple_Braille_Pinpoint_8_Dot.ttf
* Apple_Braille.ttf
* LastResort.ttf
Basic_Latin 06_umpush.ttf

4
data/fonts_whitelist.txt Normal file
View file

@ -0,0 +1,4 @@
Basic_Latin 01_dejavusans.ttf
Latin-1_Supplement 01_dejavusans.ttf
Latin_Extended-A 01_dejavusans.ttf
Latin_Extended-B 01_dejavusans.ttf

View file

@ -91,7 +91,10 @@
smallVBSize, smallIBSize, 30,
blitVBSize, blitIBSize, 20,
512, 256, 10,
GetPlatform().ReadPathForFile("unicode_blocks.txt").c_str(), 2000000));
GetPlatform().ReadPathForFile("unicode_blocks.txt").c_str(),
GetPlatform().ReadPathForFile("fonts_whitelist.txt").c_str(),
GetPlatform().ReadPathForFile("fonts_blacklist.txt").c_str(),
2000000));
resourceManager->addFonts(GetPlatform().GetFontNames());

View file

@ -26,7 +26,6 @@
EE12020F11CD464100ABDD5D /* libindexer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EE12020511CD464100ABDD5D /* libindexer.a */; };
EE12021011CD464100ABDD5D /* libmap.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EE12020611CD464100ABDD5D /* libmap.a */; };
EE12021211CD464100ABDD5D /* libyg.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EE12020811CD464100ABDD5D /* libyg.a */; };
EE12092C12BD67C900068DC3 /* wqy-microhei.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EE12092B12BD67C900068DC3 /* wqy-microhei.ttf */; };
EE583CBB12F773F00042CBE3 /* unicode_blocks.txt in Resources */ = {isa = PBXBuildFile; fileRef = EE583CBA12F773F00042CBE3 /* unicode_blocks.txt */; };
EE7F29811219ECA300EB67A9 /* RenderBuffer.mm in Sources */ = {isa = PBXBuildFile; fileRef = EE7F297D1219ECA300EB67A9 /* RenderBuffer.mm */; };
EE7F29821219ECA300EB67A9 /* RenderContext.mm in Sources */ = {isa = PBXBuildFile; fileRef = EE7F297E1219ECA300EB67A9 /* RenderContext.mm */; };
@ -38,9 +37,32 @@
EEE4C9401298A303007231A9 /* symbols_48.png in Resources */ = {isa = PBXBuildFile; fileRef = EEE4C93F1298A303007231A9 /* symbols_48.png */; };
EEE4C9421298A31B007231A9 /* basic_highres.skn in Resources */ = {isa = PBXBuildFile; fileRef = EEE4C9411298A31B007231A9 /* basic_highres.skn */; };
EEF5745512DE1AD50082F472 /* libfribidi.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EEF5745412DE1AD50082F472 /* libfribidi.a */; };
EEFC0A9612B561B7002914FF /* dejavusans.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EEFC0A9512B561B7002914FF /* dejavusans.ttf */; };
EEFC0BBF12B5656A002914FF /* libfreetype.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EE12020311CD464100ABDD5D /* libfreetype.a */; };
EEFE7BBA12F78091006AF8C3 /* mangal.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EEFE7BB912F78091006AF8C3 /* mangal.ttf */; };
EEFE7C1412F8C9E1006AF8C3 /* fonts_blacklist.txt in Resources */ = {isa = PBXBuildFile; fileRef = EEFE7C1212F8C9E1006AF8C3 /* fonts_blacklist.txt */; };
EEFE7C1512F8C9E1006AF8C3 /* fonts_whitelist.txt in Resources */ = {isa = PBXBuildFile; fileRef = EEFE7C1312F8C9E1006AF8C3 /* fonts_whitelist.txt */; };
EEFE7C4812F8CC2D006AF8C3 /* 01_dejavusans.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EEFE7C3112F8CC2D006AF8C3 /* 01_dejavusans.ttf */; };
EEFE7C4912F8CC2D006AF8C3 /* 02_wqy-microhei.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EEFE7C3212F8CC2D006AF8C3 /* 02_wqy-microhei.ttf */; };
EEFE7C4A12F8CC2D006AF8C3 /* 03_jomolhari-id-a3d.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EEFE7C3312F8CC2D006AF8C3 /* 03_jomolhari-id-a3d.ttf */; };
EEFE7C4B12F8CC2D006AF8C3 /* 04_padauk.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EEFE7C3412F8CC2D006AF8C3 /* 04_padauk.ttf */; };
EEFE7C4C12F8CC2D006AF8C3 /* 05_khmeros.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EEFE7C3512F8CC2D006AF8C3 /* 05_khmeros.ttf */; };
EEFE7C4D12F8CC2D006AF8C3 /* 06_umpush.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EEFE7C3612F8CC2D006AF8C3 /* 06_umpush.ttf */; };
EEFE7C4E12F8CC2D006AF8C3 /* 07_abyssinica_sil_r.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EEFE7C3712F8CC2D006AF8C3 /* 07_abyssinica_sil_r.ttf */; };
EEFE7C4F12F8CC2D006AF8C3 /* 08_lohit_as.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EEFE7C3812F8CC2D006AF8C3 /* 08_lohit_as.ttf */; };
EEFE7C5012F8CC2D006AF8C3 /* 09_lohit_bn.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EEFE7C3912F8CC2D006AF8C3 /* 09_lohit_bn.ttf */; };
EEFE7C5112F8CC2D006AF8C3 /* 10_lohit_gu.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EEFE7C3A12F8CC2D006AF8C3 /* 10_lohit_gu.ttf */; };
EEFE7C5212F8CC2D006AF8C3 /* 11_lohit_hi.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EEFE7C3B12F8CC2D006AF8C3 /* 11_lohit_hi.ttf */; };
EEFE7C5312F8CC2D006AF8C3 /* 12_lohit_kn.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EEFE7C3C12F8CC2D006AF8C3 /* 12_lohit_kn.ttf */; };
EEFE7C5412F8CC2D006AF8C3 /* 13_lohit_kok.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EEFE7C3D12F8CC2D006AF8C3 /* 13_lohit_kok.ttf */; };
EEFE7C5512F8CC2D006AF8C3 /* 14_lohit_ks.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EEFE7C3E12F8CC2D006AF8C3 /* 14_lohit_ks.ttf */; };
EEFE7C5612F8CC2D006AF8C3 /* 15_lohit_mai.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EEFE7C3F12F8CC2D006AF8C3 /* 15_lohit_mai.ttf */; };
EEFE7C5712F8CC2D006AF8C3 /* 16_lohit_ml.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EEFE7C4012F8CC2D006AF8C3 /* 16_lohit_ml.ttf */; };
EEFE7C5812F8CC2D006AF8C3 /* 17_lohit_mr.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EEFE7C4112F8CC2D006AF8C3 /* 17_lohit_mr.ttf */; };
EEFE7C5912F8CC2D006AF8C3 /* 18_lohit_ne.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EEFE7C4212F8CC2D006AF8C3 /* 18_lohit_ne.ttf */; };
EEFE7C5A12F8CC2D006AF8C3 /* 19_lohit_or.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EEFE7C4312F8CC2D006AF8C3 /* 19_lohit_or.ttf */; };
EEFE7C5B12F8CC2D006AF8C3 /* 20_lohit_pa.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EEFE7C4412F8CC2D006AF8C3 /* 20_lohit_pa.ttf */; };
EEFE7C5C12F8CC2D006AF8C3 /* 21_lohit_sd.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EEFE7C4512F8CC2D006AF8C3 /* 21_lohit_sd.ttf */; };
EEFE7C5D12F8CC2D006AF8C3 /* 22_lohit_ta.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EEFE7C4612F8CC2D006AF8C3 /* 22_lohit_ta.ttf */; };
EEFE7C5E12F8CC2D006AF8C3 /* 23_lohit_te.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EEFE7C4712F8CC2D006AF8C3 /* 23_lohit_te.ttf */; };
FA04373212CAB83F00017494 /* libstorage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FA04373112CAB83F00017494 /* libstorage.a */; };
FA065FED128614C400FEA989 /* MainWindow-iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = FA065FEC128614C400FEA989 /* MainWindow-iPad.xib */; };
FA065FFF1286167A00FEA989 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = FA065FFD1286167A00FEA989 /* Default@2x.png */; };
@ -93,7 +115,6 @@
EE12020511CD464100ABDD5D /* libindexer.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libindexer.a; sourceTree = SOURCE_ROOT; };
EE12020611CD464100ABDD5D /* libmap.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libmap.a; sourceTree = SOURCE_ROOT; };
EE12020811CD464100ABDD5D /* libyg.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libyg.a; sourceTree = SOURCE_ROOT; };
EE12092B12BD67C900068DC3 /* wqy-microhei.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "wqy-microhei.ttf"; path = "../../data/wqy-microhei.ttf"; sourceTree = "<group>"; };
EE16192B126E374500622BD0 /* RenderContext.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = RenderContext.hpp; path = Classes/RenderContext.hpp; sourceTree = SOURCE_ROOT; };
EE583CBA12F773F00042CBE3 /* unicode_blocks.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = unicode_blocks.txt; path = ../../data/unicode_blocks.txt; sourceTree = "<group>"; };
EE7F297C1219ECA300EB67A9 /* RenderBuffer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = RenderBuffer.hpp; path = Classes/RenderBuffer.hpp; sourceTree = SOURCE_ROOT; };
@ -109,8 +130,31 @@
EEE4C93F1298A303007231A9 /* symbols_48.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = symbols_48.png; path = ../../data/symbols_48.png; sourceTree = SOURCE_ROOT; };
EEE4C9411298A31B007231A9 /* basic_highres.skn */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = basic_highres.skn; path = ../../data/basic_highres.skn; sourceTree = SOURCE_ROOT; };
EEF5745412DE1AD50082F472 /* libfribidi.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libfribidi.a; sourceTree = SOURCE_ROOT; };
EEFC0A9512B561B7002914FF /* dejavusans.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = dejavusans.ttf; path = ../../data/dejavusans.ttf; sourceTree = "<group>"; };
EEFE7BB912F78091006AF8C3 /* mangal.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = mangal.ttf; path = ../../data/mangal.ttf; sourceTree = "<group>"; };
EEFE7C1212F8C9E1006AF8C3 /* fonts_blacklist.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = fonts_blacklist.txt; path = ../../data/fonts_blacklist.txt; sourceTree = "<group>"; };
EEFE7C1312F8C9E1006AF8C3 /* fonts_whitelist.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = fonts_whitelist.txt; path = ../../data/fonts_whitelist.txt; sourceTree = "<group>"; };
EEFE7C3112F8CC2D006AF8C3 /* 01_dejavusans.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = 01_dejavusans.ttf; path = ../../data/01_dejavusans.ttf; sourceTree = "<group>"; };
EEFE7C3212F8CC2D006AF8C3 /* 02_wqy-microhei.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "02_wqy-microhei.ttf"; path = "../../data/02_wqy-microhei.ttf"; sourceTree = "<group>"; };
EEFE7C3312F8CC2D006AF8C3 /* 03_jomolhari-id-a3d.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "03_jomolhari-id-a3d.ttf"; path = "../../data/03_jomolhari-id-a3d.ttf"; sourceTree = "<group>"; };
EEFE7C3412F8CC2D006AF8C3 /* 04_padauk.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = 04_padauk.ttf; path = ../../data/04_padauk.ttf; sourceTree = "<group>"; };
EEFE7C3512F8CC2D006AF8C3 /* 05_khmeros.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = 05_khmeros.ttf; path = ../../data/05_khmeros.ttf; sourceTree = "<group>"; };
EEFE7C3612F8CC2D006AF8C3 /* 06_umpush.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = 06_umpush.ttf; path = ../../data/06_umpush.ttf; sourceTree = "<group>"; };
EEFE7C3712F8CC2D006AF8C3 /* 07_abyssinica_sil_r.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = 07_abyssinica_sil_r.ttf; path = ../../data/07_abyssinica_sil_r.ttf; sourceTree = "<group>"; };
EEFE7C3812F8CC2D006AF8C3 /* 08_lohit_as.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = 08_lohit_as.ttf; path = ../../data/08_lohit_as.ttf; sourceTree = "<group>"; };
EEFE7C3912F8CC2D006AF8C3 /* 09_lohit_bn.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = 09_lohit_bn.ttf; path = ../../data/09_lohit_bn.ttf; sourceTree = "<group>"; };
EEFE7C3A12F8CC2D006AF8C3 /* 10_lohit_gu.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = 10_lohit_gu.ttf; path = ../../data/10_lohit_gu.ttf; sourceTree = "<group>"; };
EEFE7C3B12F8CC2D006AF8C3 /* 11_lohit_hi.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = 11_lohit_hi.ttf; path = ../../data/11_lohit_hi.ttf; sourceTree = "<group>"; };
EEFE7C3C12F8CC2D006AF8C3 /* 12_lohit_kn.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = 12_lohit_kn.ttf; path = ../../data/12_lohit_kn.ttf; sourceTree = "<group>"; };
EEFE7C3D12F8CC2D006AF8C3 /* 13_lohit_kok.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = 13_lohit_kok.ttf; path = ../../data/13_lohit_kok.ttf; sourceTree = "<group>"; };
EEFE7C3E12F8CC2D006AF8C3 /* 14_lohit_ks.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = 14_lohit_ks.ttf; path = ../../data/14_lohit_ks.ttf; sourceTree = "<group>"; };
EEFE7C3F12F8CC2D006AF8C3 /* 15_lohit_mai.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = 15_lohit_mai.ttf; path = ../../data/15_lohit_mai.ttf; sourceTree = "<group>"; };
EEFE7C4012F8CC2D006AF8C3 /* 16_lohit_ml.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = 16_lohit_ml.ttf; path = ../../data/16_lohit_ml.ttf; sourceTree = "<group>"; };
EEFE7C4112F8CC2D006AF8C3 /* 17_lohit_mr.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = 17_lohit_mr.ttf; path = ../../data/17_lohit_mr.ttf; sourceTree = "<group>"; };
EEFE7C4212F8CC2D006AF8C3 /* 18_lohit_ne.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = 18_lohit_ne.ttf; path = ../../data/18_lohit_ne.ttf; sourceTree = "<group>"; };
EEFE7C4312F8CC2D006AF8C3 /* 19_lohit_or.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = 19_lohit_or.ttf; path = ../../data/19_lohit_or.ttf; sourceTree = "<group>"; };
EEFE7C4412F8CC2D006AF8C3 /* 20_lohit_pa.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = 20_lohit_pa.ttf; path = ../../data/20_lohit_pa.ttf; sourceTree = "<group>"; };
EEFE7C4512F8CC2D006AF8C3 /* 21_lohit_sd.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = 21_lohit_sd.ttf; path = ../../data/21_lohit_sd.ttf; sourceTree = "<group>"; };
EEFE7C4612F8CC2D006AF8C3 /* 22_lohit_ta.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = 22_lohit_ta.ttf; path = ../../data/22_lohit_ta.ttf; sourceTree = "<group>"; };
EEFE7C4712F8CC2D006AF8C3 /* 23_lohit_te.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = 23_lohit_te.ttf; path = ../../data/23_lohit_te.ttf; sourceTree = "<group>"; };
FA04373112CAB83F00017494 /* libstorage.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libstorage.a; sourceTree = SOURCE_ROOT; };
FA065FEC128614C400FEA989 /* MainWindow-iPad.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = "MainWindow-iPad.xib"; path = "Resources-iPad/MainWindow-iPad.xib"; sourceTree = SOURCE_ROOT; };
FA065FFD1286167A00FEA989 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = SOURCE_ROOT; };
@ -256,13 +300,35 @@
FA065FC61286143F00FEA989 /* External Resources */ = {
isa = PBXGroup;
children = (
EEFE7BB912F78091006AF8C3 /* mangal.ttf */,
EEFE7C3112F8CC2D006AF8C3 /* 01_dejavusans.ttf */,
EEFE7C3212F8CC2D006AF8C3 /* 02_wqy-microhei.ttf */,
EEFE7C3312F8CC2D006AF8C3 /* 03_jomolhari-id-a3d.ttf */,
EEFE7C3412F8CC2D006AF8C3 /* 04_padauk.ttf */,
EEFE7C3512F8CC2D006AF8C3 /* 05_khmeros.ttf */,
EEFE7C3612F8CC2D006AF8C3 /* 06_umpush.ttf */,
EEFE7C3712F8CC2D006AF8C3 /* 07_abyssinica_sil_r.ttf */,
EEFE7C3812F8CC2D006AF8C3 /* 08_lohit_as.ttf */,
EEFE7C3912F8CC2D006AF8C3 /* 09_lohit_bn.ttf */,
EEFE7C3A12F8CC2D006AF8C3 /* 10_lohit_gu.ttf */,
EEFE7C3B12F8CC2D006AF8C3 /* 11_lohit_hi.ttf */,
EEFE7C3C12F8CC2D006AF8C3 /* 12_lohit_kn.ttf */,
EEFE7C3D12F8CC2D006AF8C3 /* 13_lohit_kok.ttf */,
EEFE7C3E12F8CC2D006AF8C3 /* 14_lohit_ks.ttf */,
EEFE7C3F12F8CC2D006AF8C3 /* 15_lohit_mai.ttf */,
EEFE7C4012F8CC2D006AF8C3 /* 16_lohit_ml.ttf */,
EEFE7C4112F8CC2D006AF8C3 /* 17_lohit_mr.ttf */,
EEFE7C4212F8CC2D006AF8C3 /* 18_lohit_ne.ttf */,
EEFE7C4312F8CC2D006AF8C3 /* 19_lohit_or.ttf */,
EEFE7C4412F8CC2D006AF8C3 /* 20_lohit_pa.ttf */,
EEFE7C4512F8CC2D006AF8C3 /* 21_lohit_sd.ttf */,
EEFE7C4612F8CC2D006AF8C3 /* 22_lohit_ta.ttf */,
EEFE7C4712F8CC2D006AF8C3 /* 23_lohit_te.ttf */,
EEFE7C1212F8C9E1006AF8C3 /* fonts_blacklist.txt */,
EEFE7C1312F8C9E1006AF8C3 /* fonts_whitelist.txt */,
EE583CBA12F773F00042CBE3 /* unicode_blocks.txt */,
FA57ADF312F338FB002BFB9D /* countries_poly.txt */,
FA46DA2B12D4166E00968C36 /* countries.txt */,
FA46DA0412D414D200968C36 /* maps.update */,
EE12092B12BD67C900068DC3 /* wqy-microhei.ttf */,
EEFC0A9512B561B7002914FF /* dejavusans.ttf */,
EEE4C9411298A31B007231A9 /* basic_highres.skn */,
EEE4C93F1298A303007231A9 /* symbols_48.png */,
EEE4C93D1298A2F3007231A9 /* symbols_24.png */,
@ -396,13 +462,35 @@
EEE4C93E1298A2F3007231A9 /* symbols_24.png in Resources */,
EEE4C9401298A303007231A9 /* symbols_48.png in Resources */,
EEE4C9421298A31B007231A9 /* basic_highres.skn in Resources */,
EEFC0A9612B561B7002914FF /* dejavusans.ttf in Resources */,
EE12092C12BD67C900068DC3 /* wqy-microhei.ttf in Resources */,
FA46DA0512D414D200968C36 /* maps.update in Resources */,
FA46DA2C12D4166E00968C36 /* countries.txt in Resources */,
FA57ADF412F338FB002BFB9D /* countries_poly.txt in Resources */,
EE583CBB12F773F00042CBE3 /* unicode_blocks.txt in Resources */,
EEFE7BBA12F78091006AF8C3 /* mangal.ttf in Resources */,
EEFE7C1412F8C9E1006AF8C3 /* fonts_blacklist.txt in Resources */,
EEFE7C1512F8C9E1006AF8C3 /* fonts_whitelist.txt in Resources */,
EEFE7C4812F8CC2D006AF8C3 /* 01_dejavusans.ttf in Resources */,
EEFE7C4912F8CC2D006AF8C3 /* 02_wqy-microhei.ttf in Resources */,
EEFE7C4A12F8CC2D006AF8C3 /* 03_jomolhari-id-a3d.ttf in Resources */,
EEFE7C4B12F8CC2D006AF8C3 /* 04_padauk.ttf in Resources */,
EEFE7C4C12F8CC2D006AF8C3 /* 05_khmeros.ttf in Resources */,
EEFE7C4D12F8CC2D006AF8C3 /* 06_umpush.ttf in Resources */,
EEFE7C4E12F8CC2D006AF8C3 /* 07_abyssinica_sil_r.ttf in Resources */,
EEFE7C4F12F8CC2D006AF8C3 /* 08_lohit_as.ttf in Resources */,
EEFE7C5012F8CC2D006AF8C3 /* 09_lohit_bn.ttf in Resources */,
EEFE7C5112F8CC2D006AF8C3 /* 10_lohit_gu.ttf in Resources */,
EEFE7C5212F8CC2D006AF8C3 /* 11_lohit_hi.ttf in Resources */,
EEFE7C5312F8CC2D006AF8C3 /* 12_lohit_kn.ttf in Resources */,
EEFE7C5412F8CC2D006AF8C3 /* 13_lohit_kok.ttf in Resources */,
EEFE7C5512F8CC2D006AF8C3 /* 14_lohit_ks.ttf in Resources */,
EEFE7C5612F8CC2D006AF8C3 /* 15_lohit_mai.ttf in Resources */,
EEFE7C5712F8CC2D006AF8C3 /* 16_lohit_ml.ttf in Resources */,
EEFE7C5812F8CC2D006AF8C3 /* 17_lohit_mr.ttf in Resources */,
EEFE7C5912F8CC2D006AF8C3 /* 18_lohit_ne.ttf in Resources */,
EEFE7C5A12F8CC2D006AF8C3 /* 19_lohit_or.ttf in Resources */,
EEFE7C5B12F8CC2D006AF8C3 /* 20_lohit_pa.ttf in Resources */,
EEFE7C5C12F8CC2D006AF8C3 /* 21_lohit_sd.ttf in Resources */,
EEFE7C5D12F8CC2D006AF8C3 /* 22_lohit_ta.ttf in Resources */,
EEFE7C5E12F8CC2D006AF8C3 /* 23_lohit_te.ttf in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View file

@ -171,17 +171,16 @@ bool IPhonePlatform::DoPeriodicalUpdate() const
vector<string> IPhonePlatform::GetFontNames() const
{
vector<string> res;
/* string fontFolder("/System/Library/Fonts/");
string fontFolder = m_resourcesPath;
GetFilesInDir(fontFolder, ".ttf", res);
for (int i = 0; i < res.size(); ++i)
res[i] = fontFolder + res[i];
*/
res.push_back(ReadPathForFile("wqy-microhei.ttf"));
/* res.push_back(ReadPathForFile("wqy-microhei.ttf"));
res.push_back(ReadPathForFile("dejavusans.ttf"));
res.push_back(ReadPathForFile("mangal.ttf"));
*/
return res;
}

View file

@ -362,20 +362,15 @@ public:
{
vector<string> res;
/*#if defined(OMIM_OS_WINDOWS)
string fontFolder = "C:\\Windows\\Fonts\\"
#elif defined(OMIM_OS_MAC)
string fontFolder = "/System/Library/Fonts/";
#endif
string fontFolder = m_resourcesDir;
//string fontFolder = "/Library/Fonts/";
GetFilesInDir(fontFolder, "*.ttf", res);
sort(res.begin(), res.end());
for (int i = 0; i < res.size(); ++i)
res[i] = fontFolder + res[i];
*/
res.push_back(ReadPathForFile("wqy-microhei.ttf"));
res.push_back(ReadPathForFile("dejavusans.ttf"));
res.push_back(ReadPathForFile("mangal.ttf"));
return res;
}

View file

@ -29,7 +29,30 @@ macx {
CLASSIFICATOR_RESOURCES.path = Contents/Resources
SKIN_RESOURCES.files = ../data/basic.skn ../data/basic_highres.skn ../data/symbols_48.png ../data/symbols_24.png
SKIN_RESOURCES.path = Contents/Resources
FONT_RESOURCES.files = ../data/wqy-microhei.ttf
FONT_RESOURCES.files = ../data/01_dejavusans.ttf \
../data/02_wqy-microhei.ttf \
../data/03_jomolhari-id-a3d.ttf \
../data/04_padauk.ttf \
../data/05_khmeros.ttf \
../data/06_umpush.ttf \
../data/07_abyssinica_sil_r.ttf \
../data/08_lohit_as.ttf \
../data/09_lohit_bn.ttf \
../data/10_lohit_gu.ttf \
../data/11_lohit_hi.ttf \
../data/12_lohit_kn.ttf \
../data/13_lohit_kok.ttf \
../data/14_lohit_ks.ttf \
../data/15_lohit_mai.ttf \
../data/16_lohit_ml.ttf \
../data/17_lohit_mr.ttf \
../data/18_lohit_ne.ttf \
../data/19_lohit_or.ttf \
../data/20_lohit_pa.ttf \
../data/21_lohit_sd.ttf \
../data/22_lohit_ta.ttf \
../data/23_lohit_te.ttf
FONT_RESOURCES.path = Contents/Resources
QMAKE_BUNDLE_DATA += CLASSIFICATOR_RESOURCES SKIN_RESOURCES FONT_RESOURCES
}

View file

@ -45,7 +45,10 @@ namespace qt
50,
512, 256,
15,
GetPlatform().ReadPathForFile("unicode_blocks.txt").c_str(), 2000000));
GetPlatform().ReadPathForFile("unicode_blocks.txt").c_str(),
GetPlatform().ReadPathForFile("fonts_whitelist.txt").c_str(),
GetPlatform().ReadPathForFile("fonts_blacklist.txt").c_str(),
2000000));
m_resourceManager->addFonts(GetPlatform().GetFontNames());

View file

@ -50,7 +50,10 @@ void GLDrawWidget::initializeGL()
10 * sizeof(unsigned short),
30,
512, 256, 15,
GetPlatform().ReadPathForFile("unicode_blocks.txt").c_str(), 2000000));
GetPlatform().ReadPathForFile("unicode_blocks.txt").c_str(),
GetPlatform().ReadPathForFile("fonts_whitelist.txt").c_str(),
GetPlatform().ReadPathForFile("fonts_blacklist.txt").c_str(),
2000000));
m_resourceManager->addFonts(GetPlatform().GetFontNames());

View file

@ -35,7 +35,11 @@ namespace yg
return l.m_isMask < r.m_isMask;
}
GlyphCache::GlyphCache(string const & blocksFileName, size_t maxSize) : m_impl(new GlyphCacheImpl(blocksFileName, maxSize))
GlyphCache::Params::Params(char const * blocksFile, char const * whiteListFile, char const * blackListFile, size_t maxSize)
: m_blocksFile(blocksFile), m_whiteListFile(whiteListFile), m_blackListFile(blackListFile), m_maxSize(maxSize)
{}
GlyphCache::GlyphCache(Params const & params) : m_impl(new GlyphCacheImpl(params))
{
}
@ -49,48 +53,56 @@ namespace yg
m_impl->addFonts(fontNames);
}
int GlyphCache::getCharIDX(GlyphKey const & key)
pair<Font*, int> GlyphCache::getCharIDX(GlyphKey const & key)
{
vector<shared_ptr<Font> > & fonts = m_impl->getFonts(key.m_id);
FTC_FaceID faceID = reinterpret_cast<FTC_FaceID>(fonts.front().get());
Font * font = 0;
int charIDX = FTC_CMapCache_Lookup(
m_impl->m_charMapCache,
faceID,
-1,
key.m_id
);
int charIDX;
if (charIDX == 0)
for (int i = 0; i < fonts.size(); ++i)
{
font = fonts[i].get();
FTC_FaceID faceID = reinterpret_cast<FTC_FaceID>(font);
charIDX = FTC_CMapCache_Lookup(
m_impl->m_charMapCache,
faceID,
-1,
65533
key.m_id
);
if (charIDX == 0)
charIDX = FTC_CMapCache_Lookup(
m_impl->m_charMapCache,
faceID,
-1,
32
);
if (charIDX != 0)
return make_pair(font, charIDX);
}
return charIDX;
font = fonts.front().get();
/// taking substitution character from the first font in the list
charIDX = FTC_CMapCache_Lookup(
m_impl->m_charMapCache,
reinterpret_cast<FTC_FaceID>(font),
-1,
65533
);
if (charIDX == 0)
charIDX = FTC_CMapCache_Lookup(
m_impl->m_charMapCache,
reinterpret_cast<FTC_FaceID>(font),
-1,
32
);
return make_pair(font, charIDX);
}
GlyphMetrics const GlyphCache::getGlyphMetrics(GlyphKey const & key)
{
vector<shared_ptr<Font> > & fonts = m_impl->getFonts(key.m_id);
FTC_FaceID faceID = reinterpret_cast<FTC_FaceID>(fonts.front().get());
pair<Font*, int> charIDX = getCharIDX(key);
FTC_ScalerRec fontScaler =
{
faceID,
reinterpret_cast<FTC_FaceID>(charIDX.first),
key.m_fontSize,
key.m_fontSize,
1,
@ -98,15 +110,13 @@ namespace yg
0
};
int charIDX = getCharIDX(key);
FT_Glyph glyph = 0;
FTCHECK(FTC_ImageCache_LookupScaler(
m_impl->m_glyphMetricsCache,
&fontScaler,
FT_LOAD_DEFAULT,
charIDX,
charIDX.second,
&glyph,
0));
@ -126,11 +136,11 @@ namespace yg
shared_ptr<GlyphInfo> const GlyphCache::getGlyph(GlyphKey const & key)
{
vector<shared_ptr<Font> > & fonts = m_impl->getFonts(key.m_id);
FTC_FaceID faceID = reinterpret_cast<FTC_FaceID>(fonts.front().get());
pair<Font *, int> charIDX = getCharIDX(key);
FTC_ScalerRec fontScaler =
{
faceID,
reinterpret_cast<FTC_FaceID>(charIDX.first),
key.m_fontSize,
key.m_fontSize,
1,
@ -138,17 +148,14 @@ namespace yg
0
};
int charIDX = getCharIDX(key);
FT_Glyph glyph = 0;
//FTC_Node glyphNode;
if (key.m_isMask)
FTCHECK(FTC_ImageCache_LookupScaler(
m_impl->m_strokedGlyphCache,
&fontScaler,
FT_LOAD_DEFAULT,
charIDX,
charIDX.second,
&glyph,
0
));
@ -157,7 +164,7 @@ namespace yg
m_impl->m_normalGlyphCache,
&fontScaler,
FT_LOAD_DEFAULT | FT_LOAD_RENDER,
charIDX,
charIDX.second,
&glyph,
0
));

View file

@ -3,6 +3,7 @@
#include "../std/shared_ptr.hpp"
#include "../std/vector.hpp"
#include "../std/string.hpp"
#include "../std/utility.hpp"
#include "color.hpp"
namespace yg
@ -35,6 +36,8 @@ namespace yg
GlyphKey(int id, int fontSize, bool isMask);
};
struct Font;
bool operator<(GlyphKey const & l, GlyphKey const & r);
struct GlyphCacheImpl;
@ -47,13 +50,22 @@ namespace yg
public:
GlyphCache(string const & blocksFileName, size_t maxSize);
struct Params
{
string m_blocksFile;
string m_whiteListFile;
string m_blackListFile;
size_t m_maxSize;
Params(char const * blocksFile, char const * whiteListFile, char const * blackListFile, size_t maxSize);
};
GlyphCache(Params const & params);
void reset();
void addFont(char const * fileName);
void addFonts(vector<string> const & fontNames);
int getCharIDX(GlyphKey const & key);
pair<Font*, int> getCharIDX(GlyphKey const & key);
shared_ptr<GlyphInfo> const getGlyph(GlyphKey const & key);
/// return control box(could be slightly larger than the precise bound box).

View file

@ -8,13 +8,15 @@
#include <../cache/ftccache.h>
#include "../std/fstream.hpp"
#include "../std/bind.hpp"
#include "../base/path_utils.hpp"
#include "../base/ptr_utils.hpp"
namespace yg
{
UnicodeBlock::UnicodeBlock(string const & name, uint32_t start, uint32_t end)
: m_start(start), m_end(end), m_name(name)
: m_name(name), m_start(start), m_end(end)
{}
bool UnicodeBlock::hasSymbol(uint16_t sym) const
@ -49,6 +51,58 @@ namespace yg
m_lastUsedBlock = m_unicodeBlocks.end();
}
bool find_ub_by_name(string const & ubName, UnicodeBlock const & ub)
{
return ubName == ub.m_name;
}
void GlyphCacheImpl::initFonts(string const & whiteListFile, string const & blackListFile)
{
{
ifstream fin(whiteListFile.c_str());
while (true)
{
string ubName;
string fontName;
fin >> ubName >> fontName;
if (!fin)
break;
if (ubName == "*")
for (unicode_blocks_t::iterator it = m_unicodeBlocks.begin(); it != m_unicodeBlocks.end(); ++it)
it->m_whitelist.push_back(fontName);
else
{
unicode_blocks_t::iterator it = find_if(m_unicodeBlocks.begin(), m_unicodeBlocks.end(), bind(&find_ub_by_name, ubName, _1));
if (it != m_unicodeBlocks.end())
it->m_whitelist.push_back(fontName);
}
}
}
{
ifstream fin(blackListFile.c_str());
while (true)
{
string ubName;
string fontName;
fin >> ubName >> fontName;
if (!fin)
break;
if (ubName == "*")
for (unicode_blocks_t::iterator it = m_unicodeBlocks.begin(); it != m_unicodeBlocks.end(); ++it)
it->m_blacklist.push_back(fontName);
else
{
unicode_blocks_t::iterator it = find_if(m_unicodeBlocks.begin(), m_unicodeBlocks.end(), bind(&find_ub_by_name, ubName, _1));
if (it != m_unicodeBlocks.end())
it->m_blacklist.push_back(fontName);
}
}
}
}
bool sym_in_block(UnicodeBlock & b, uint16_t sym)
{
return (b.m_start <= sym);
@ -65,14 +119,17 @@ namespace yg
addFont(fontNames[i].c_str());
for (unicode_blocks_t::const_iterator it = m_unicodeBlocks.begin(); it != m_unicodeBlocks.end(); ++it)
{
if (it->m_fonts.empty())
LOG(LINFO, (it->m_name, " unicode block is empty"));
}
LOG(LINFO, (it->m_name, " unicode block of ", it->m_end + 1 - it->m_start, " symbols is empty"));
}
void GlyphCacheImpl::addFont(char const * fileName)
{
string fontName = extract_name(fileName);
for (int i = 0; i < fontName.size(); ++i)
if (fontName[i] == ' ')
fontName[i] = '_';
m_fonts.push_back(make_shared_ptr(new Font(fileName)));
/// obtaining all glyphs, supported by this font
@ -98,12 +155,15 @@ namespace yg
unicode_blocks_t::iterator ubIt = m_unicodeBlocks.begin();
vector<FT_ULong>::iterator ccIt = charcodes.begin();
typedef vector<unicode_blocks_t::const_iterator> touched_blocks_t;
touched_blocks_t touchedBlocks;
while (true)
{
while (ubIt != m_unicodeBlocks.end())
{
if ((*ccIt > lastUBEnd) && (*ccIt < ubIt->m_start))
LOG(LINFO, ("Symbol with code ", (uint16_t)*ccIt, "lies between two unicode blocks!"));
LOG(LINFO, ("Symbol with code ", (uint16_t)*ccIt, " present in font lies between two unicode blocks!"));
if (ubIt->hasSymbol(*ccIt))
break;
lastUBEnd = ubIt->m_end;
@ -118,12 +178,41 @@ namespace yg
{
ubIt->m_fonts.push_back(m_fonts.back());
ubIt->m_coverage.push_back(0);
touchedBlocks.push_back(ubIt);
/// checking blacklist and whitelist
for (int i = 0; i < ubIt->m_blacklist.size(); ++i)
if (ubIt->m_blacklist[i] == fontName)
/// if font is blacklisted for this unicode block
ubIt->m_coverage.back() = -1;
for (int i = 0; i < ubIt->m_whitelist.size(); ++i)
if (ubIt->m_whitelist[i] == fontName)
{
if (ubIt->m_coverage.back() == -1)
LOG(LWARNING, ("font ", fontName, "is present both at blacklist and whitelist. whitelist prevails."));
/// weight used for sorting are boosted to the top.
/// the order of elements are saved by adding 'i' value as a shift.
ubIt->m_coverage.back() = ubIt->m_end + 1 - ubIt->m_start + i + 1;
}
}
++ubIt->m_coverage.back();
if ((ubIt->m_coverage.back() >= 0) && (ubIt->m_coverage.back() < ubIt->m_end + 1 - ubIt->m_start))
++ubIt->m_coverage.back();
++ccIt;
}
LOG(LINFO, ("-----------------------------------------"));
LOG(LINFO, ("Unicode Blocks for Font : ", extract_name(fileName)));
LOG(LINFO, ("-----------------------------------------"));
/// dumping touched unicode blocks
for (touched_blocks_t::const_iterator it = touchedBlocks.begin(); it != touchedBlocks.end(); ++it)
{
LOG(LINFO, ((*it)->m_name, " with coverage ", (*it)->m_coverage.back(), " out of ", (*it)->m_end + 1 - (*it)->m_start));
}
/// rearrange fonts in all unicode blocks according to it's coverage
for (ubIt = m_unicodeBlocks.begin(); ubIt != m_unicodeBlocks.end(); ++ubIt)
{
@ -164,7 +253,10 @@ namespace yg
if ((it != m_unicodeBlocks.end()) && (it->hasSymbol(sym)))
{
if (it->m_fonts.empty())
{
LOG(LINFO, ("querying symbol for empty ", it->m_name, " unicode block"));
it->m_fonts.push_back(m_fonts.front());
}
return it->m_fonts;
}
@ -173,14 +265,15 @@ namespace yg
}
GlyphCacheImpl::GlyphCacheImpl(std::string const & blocksFileName, size_t maxSize)
GlyphCacheImpl::GlyphCacheImpl(GlyphCache::Params const & params)
{
initBlocks(blocksFileName);
initBlocks(params.m_blocksFile);
initFonts(params.m_whiteListFile, params.m_blackListFile);
FTCHECK(FT_Init_FreeType(&m_lib));
/// Initializing caches
FTCHECK(FTC_Manager_New(m_lib, 3, 10, maxSize, &RequestFace, 0, &m_manager));
FTCHECK(FTC_Manager_New(m_lib, 3, 10, params.m_maxSize, &RequestFace, 0, &m_manager));
FTCHECK(FTC_ImageCache_New(m_manager, &m_normalGlyphCache));
FTCHECK(FTC_ImageCache_New(m_manager, &m_glyphMetricsCache));

View file

@ -1,5 +1,7 @@
#pragma once
#include "glyph_cache.hpp"
#include "ft2_debug.hpp"
#include "../std/string.hpp"
#include "../std/vector.hpp"
@ -26,6 +28,15 @@ namespace yg
struct UnicodeBlock
{
string m_name;
/// @{ Font Tuning
/// whitelist has priority over the blacklist in case of duplicates.
/// this fonts are promoted to the top of the font list for this block.
vector<string> m_whitelist;
/// this fonts are removed from the font list for this block.
vector<string> m_blacklist;
/// @}
uint32_t m_start;
uint32_t m_end;
/// sorted indices in m_fonts, from the best to the worst
@ -60,12 +71,13 @@ namespace yg
static FT_Error RequestFace(FTC_FaceID faceID, FT_Library library, FT_Pointer requestData, FT_Face * face);
void initBlocks(string const & fileName);
void initFonts(string const & whiteListFile, string const & blackListFile);
vector<shared_ptr<Font> > & getFonts(uint16_t sym);
void addFont(char const * fileName);
void addFonts(vector<string> const & fontNames);
GlyphCacheImpl(string const & blocksFileName, size_t maxSize);
GlyphCacheImpl(GlyphCache::Params const & params);
~GlyphCacheImpl();
};
}

View file

@ -20,7 +20,8 @@ namespace yg
size_t smallVBSize, size_t smallIBSize, size_t smallStoragesCount,
size_t blitVBSize, size_t blitIBSize, size_t blitStoragesCount,
size_t texWidth, size_t texHeight, size_t texCount,
char const * blocksFileName, size_t maxGlyphCacheSize) : m_glyphCache(blocksFileName, maxGlyphCacheSize)
char const * blocksFile, char const * whiteListFile, char const * blackListFile, size_t maxGlyphCacheSize)
: m_glyphCache(GlyphCache::Params(blocksFile, whiteListFile, blackListFile, maxGlyphCacheSize))
{
for (size_t i = 0; i < storagesCount; ++i)
m_storages.push_back(gl::Storage(vbSize, ibSize));

View file

@ -49,7 +49,7 @@ namespace yg
size_t smallVBSize, size_t smallIBSize, size_t smallStoragesCount,
size_t blitVBSize, size_t blitIBSize, size_t blitStoragesCount,
size_t texWidth, size_t texHeight, size_t texCount,
char const * blocksFileName, size_t maxGlyphCacheSize);
char const * blocksFile, char const * whileListFile, char const * blackListFile, size_t maxGlyphCacheSize);
shared_ptr<gl::BaseTexture> const & getTexture(string const & fileName);

View file

@ -5,7 +5,7 @@
UNIT_TEST(GlyphCacheTest_Main)
{
yg::GlyphCache cache("", 200000);
yg::GlyphCache cache(yg::GlyphCache::Params("", "", "", 200000));
cache.addFont(GetPlatform().ReadPathForFile("dejavusans.ttf").c_str());
shared_ptr<yg::GlyphInfo> g1 = cache.getGlyph(yg::GlyphKey('#', 40, true));
// g1->dump(GetPlatform().WritablePathForFile("#_mask.png").c_str());

View file

@ -8,6 +8,6 @@
UNIT_TEST(SkinLoaderTest_Main)
{
GL_TEST_START;
shared_ptr<yg::ResourceManager> rm(new yg::ResourceManager(1000, 1000, 2, 1000, 1000, 2, 1000, 1000, 2, 128, 128, 15, "", 2000000));
shared_ptr<yg::ResourceManager> rm(new yg::ResourceManager(1000, 1000, 2, 1000, 1000, 2, 1000, 1000, 2, 128, 128, 15, "", "", "", 2000000));
/*yg::Skin * skin = */loadSkin(rm, "basic.skn", 2, 2);
};

View file

@ -9,7 +9,7 @@ UNIT_TEST(SkinTest_Main)
{
GL_TEST_START;
shared_ptr<yg::ResourceManager> rm(new yg::ResourceManager(100, 100, 1, 100, 100, 1, 100, 100, 1, 128, 128, 15, "", 2000000));
shared_ptr<yg::ResourceManager> rm(new yg::ResourceManager(100, 100, 1, 100, 100, 1, 100, 100, 1, 128, 128, 15, "", "", "", 2000000));
yg::Skin * skin = loadSkin(rm, "test.skn", 2, 2);
double p0 [] = {1, 1};