You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(20) |
Feb
(14) |
Mar
(17) |
Apr
(60) |
May
(15) |
Jun
(51) |
Jul
(88) |
Aug
(21) |
Sep
(24) |
Oct
(1) |
Nov
(33) |
Dec
(16) |
2004 |
Jan
(27) |
Feb
(5) |
Mar
(6) |
Apr
(50) |
May
(6) |
Jun
(12) |
Jul
(14) |
Aug
(12) |
Sep
(21) |
Oct
(46) |
Nov
(1) |
Dec
(4) |
2005 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
(8) |
Jun
(23) |
Jul
|
Aug
(23) |
Sep
(1) |
Oct
(3) |
Nov
|
Dec
|
From: <sil...@li...> - 2004-10-27 14:32:45
|
Update of /cvsroot/silgraphite/silgraphite/contrib/RegressionTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11188/contrib/RegressionTest Modified Files: Tag: v2api RegressionTest.cpp TestCase.cpp TestCase.h Log Message: Synchronized with FW changelist #12044: began ITextSource rework Index: RegressionTest.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/RegressionTest/RegressionTest.cpp,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -d -r1.3 -r1.3.2.1 --- RegressionTest.cpp 6 Oct 2004 18:28:29 -0000 1.3 +++ RegressionTest.cpp 27 Oct 2004 14:31:58 -0000 1.3.2.1 @@ -160,10 +160,11 @@ // Set up the text source. text = ptcase->Text(); - OLECHAR featureBuf[1024]; - wcscpy(featureBuf, ptcase->FeatureString().data()); - pgrtext = new GrTextSrc(&(text[0]), chrp, - featureBuf, (int)ptcase->FeatureString().size()); + pgrtext = new GrTextSrc(&(text[0]), + chrp.szFaceName, (chrp.dympHeight / 1000), + (chrp.ttvBold != kttvOff), (chrp.ttvItalic != kttvOff), + chrp.fWsRtl, (chrp.dympOffset / 1000), chrp.clrFore, chrp.clrBack, + ptcase->NumFeats(), ptcase->FeatIdList(), ptcase->FeatValList()); OLECHAR errMsg[10]; @@ -427,6 +428,8 @@ /*---------------------------------------------------------------------------------------------- Set up a GrGraphics object for the test case. + + TODO: Eventually get rid of GrCharProps. ----------------------------------------------------------------------------------------------*/ bool SetupGraphics(TestCase * ptcase, GrGraphics * pgrfx, GrCharProps * pchrp) { Index: TestCase.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/RegressionTest/TestCase.cpp,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -d -r1.2 -r1.2.2.1 --- TestCase.cpp 20 Aug 2004 18:40:52 -0000 1.2 +++ TestCase.cpp 27 Oct 2004 14:31:58 -0000 1.2.2.1 @@ -76,7 +76,7 @@ m_text = L"This is a test."; // text to render m_fontSize = 12; // font size in points m_prefBreak = klbWordBreak; // preferred break-weight - m_featureString.erase(); + m_cfid = 0; // no features m_availWidth = 500; // width available for segment m_bold = false; m_italic = false; @@ -135,7 +135,7 @@ m_text = L"This is a test."; // text to render m_fontSize = 12; // font size in points m_prefBreak = klbWordBreak; // preferred break-weight - m_featureString.erase(); + m_cfid = 0; // no features m_availWidth = 500; // width available for segment m_bold = false; m_italic = false; @@ -189,7 +189,7 @@ m_text = BurmeseText(); m_fontSize = 20; // font size in points m_prefBreak = klbWordBreak; // preferred break-weight - m_featureString.erase(); + m_cfid = 0; // no features m_availWidth = 300; // width available for segment m_bold = false; m_italic = false; @@ -218,7 +218,7 @@ m_text = BurmeseText(); m_fontSize = 20; // font size in points m_prefBreak = klbWordBreak; // preferred break-weight - m_featureString.erase(); + m_cfid = 0; // no features m_availWidth = 275; // width available for segment m_bold = false; m_italic = false; @@ -247,7 +247,7 @@ m_text = BurmeseText(); m_fontSize = 20; // font size in points m_prefBreak = klbWordBreak; // preferred break-weight - m_featureString.erase(); + m_cfid = 0; // no features m_availWidth = 75; // width available for segment m_bold = false; m_italic = false; @@ -276,7 +276,7 @@ m_text = BurmeseText(); m_fontSize = 20; // font size in points m_prefBreak = klbWordBreak; // preferred break-weight - m_featureString.erase(); + m_cfid = 0; // no features m_availWidth = 30; // width available for segment m_bold = false; m_italic = false; @@ -368,7 +368,7 @@ m_text = RomanText(); // text to render m_fontSize = 36; // font size in points m_prefBreak = klbWordBreak; // preferred break-weight - m_featureString.erase(); + m_cfid = 0; // no features m_availWidth = 500; // width available for segment m_bold = false; m_italic = false; @@ -426,7 +426,12 @@ m_text = RomanText(); // text to render m_fontSize = 36; // font size in points m_prefBreak = klbWordBreak; // preferred break-weight - m_featureString = L"1024=2,1026=1,1029=1,1032=1,1034=1"; + m_cfid = 5; + m_fid[0] = 1024; m_fval[0] = 2; + m_fid[1] = 1026; m_fval[1] = 1; + m_fid[2] = 1029; m_fval[2] = 1; + m_fid[3] = 1032; m_fval[3] = 1; + m_fid[4] = 1034; m_fval[4] = 1; m_availWidth = 500; // width available for segment m_bold = false; m_italic = false; @@ -499,7 +504,7 @@ m_text = L"The quick brown fox."; // text to render m_fontSize = 12; // font size in points m_prefBreak = klbWordBreak; // preferred break-weight - m_featureString.erase(); + m_cfid = 0; // no features m_availWidth = 150; // width available for segment m_bold = false; m_italic = false; @@ -551,7 +556,7 @@ m_firstChar = 15; // spaces after brown m_fontSize = 12; // font size in points m_prefBreak = klbWordBreak; // preferred break-weight - m_featureString.erase(); + m_cfid = 0; // no features m_availWidth = 2; // width available for segment m_bold = false; m_italic = false; @@ -581,7 +586,7 @@ m_text = L" fox."; // text to render m_fontSize = 12; // font size in points m_prefBreak = klbWordBreak; // preferred break-weight - m_featureString.erase(); + m_cfid = 0; // no features m_availWidth = 2; // width available for segment m_bold = false; m_italic = false; @@ -641,7 +646,7 @@ m_text = CrossLineText(); // "abcddddefx@ghijkmmmmn$yopppppqrsss$z@tttwwww"; m_fontSize = 30; // font size in points m_prefBreak = klbHyphenBreak; // preferred break-weight - m_featureString.erase(); + m_cfid = 0; // no features m_availWidth = 350; // width available for segment m_bold = false; m_italic = false; @@ -702,7 +707,7 @@ m_firstChar = 10; m_fontSize = 30; // font size in points m_prefBreak = klbHyphenBreak; // preferred break-weight - m_featureString.erase(); + m_cfid = 0; // no features m_availWidth = 400; // width available for segment m_bold = false; m_italic = false; @@ -718,7 +723,8 @@ // need charCnt elements in this array: bool insPtFlags[] = { - false, true, true, true, true, true, true, true, true, true, true, true, true + true, // used to be false, not sure what changed + true, true, true, true, true, true, true, true, true, true, true, true }; const int glyphCnt = 15; // number of glyphs in the segment @@ -767,7 +773,7 @@ m_firstChar = 23; m_fontSize = 30; // font size in points m_prefBreak = klbHyphenBreak; // preferred break-weight - m_featureString.erase(); + m_cfid; // no features m_availWidth = 400; // width available for segment m_bold = false; m_italic = false; @@ -832,7 +838,7 @@ m_firstChar = 36; m_fontSize = 30; // font size in points m_prefBreak = klbHyphenBreak; // preferred break-weight - m_featureString.erase(); + m_cfid = 0; // no features m_availWidth = 400; // width available for segment m_bold = false; m_italic = false; @@ -923,7 +929,7 @@ m_text.erase(); // text to render m_fontSize = 12; // font size in points m_prefBreak = klbWordBreak; // preferred break-weight - m_featureString.erase(); + m_cfid = 0; // no features m_availWidth = 500; // width available for segment m_bold = false; m_italic = false; Index: TestCase.h =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/RegressionTest/TestCase.h,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -d -r1.1 -r1.1.2.1 --- TestCase.h 10 Jun 2004 20:19:43 -0000 1.1 +++ TestCase.h 27 Oct 2004 14:31:58 -0000 1.1.2.1 @@ -69,9 +69,11 @@ std::string FontName() { return m_fontName; } size_t FontSize() { return m_fontSize; } LgLineBreak PrefBreak() { return m_prefBreak; } - std::wstring FeatureString() { return m_featureString; } int AvailWidth() { return m_availWidth; } bool Backtrack() { return m_backtrack; } + int NumFeats() { return m_cfid; } + int * FeatIdList() { return m_fid; } + int * FeatValList() { return m_fval; } LgTrailingWsHandling Twsh() { return m_twsh; } bool ParaRtl() { return m_paraRtl; } size_t FirstChar() { return m_firstChar; } @@ -139,7 +141,6 @@ std::string m_fontName; // default: empty size_t m_fontSize; // default: 12 LgLineBreak m_prefBreak; // default: word-break - std::wstring m_featureString; // default: none int m_availWidth; // default: 100 bool m_bold; // default: false bool m_italic; // default: false @@ -149,6 +150,9 @@ size_t m_firstChar; // default: 0 size_t m_contextBlockInSize; // default: 0 byte * m_contextBlockIn; // default: NULL + int m_cfid; // number of features; default: 0 + int m_fid[8]; + int m_fval[8]; // start of line flag // resolution // justification |
From: <sil...@li...> - 2004-10-27 14:32:45
|
Update of /cvsroot/silgraphite/silgraphite/contrib/HelloWorld In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11188/contrib/HelloWorld Modified Files: Tag: v2api GrTextSrc.cpp GrTextSrc.h HelloWorld.cpp Log Message: Synchronized with FW changelist #12044: began ITextSource rework Index: GrTextSrc.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/HelloWorld/GrTextSrc.cpp,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -d -r1.4 -r1.4.2.1 --- GrTextSrc.cpp 6 Oct 2004 18:28:23 -0000 1.4 +++ GrTextSrc.cpp 27 Oct 2004 14:31:50 -0000 1.4.2.1 @@ -15,18 +15,12 @@ #include "GrClient.h" #include "GrTextSrc.h" -GrTextSrc::GrTextSrc(OLECHAR * pszText, GrCharProps & chrp, - OLECHAR * prgchFontVar, int ichFontVar) +GrTextSrc::GrTextSrc(OLECHAR * pszText) { m_cchLength = (int)wcslen(pszText); m_prgchText = new OLECHAR[m_cchLength + 1]; memcpy(m_prgchText, pszText, isizeof(OLECHAR) * m_cchLength); m_prgchText[m_cchLength] = L'\0'; // zero-terminate - - memcpy(&m_chrp, &chrp, isizeof(GrCharProps)); - memset(m_rgchFontVar, 0, isizeof(m_rgchFontVar)); - memcpy(m_rgchFontVar, prgchFontVar, - min((unsigned int)(ichFontVar * isizeof(OLECHAR)), sizeof(m_rgchFontVar))); } GrTextSrc::~GrTextSrc() @@ -52,7 +46,7 @@ GrResult GrTextSrc::GetCharProps(int ich, GrCharProps * pchrp, int * pichMin, int * pichLim) { - memcpy(pchrp, &m_chrp, isizeof(GrCharProps)); + memset(pchrp, 0, isizeof(GrCharProps)); *pichMin = 0; *pichLim = m_cchLength; return kresOk; @@ -69,16 +63,7 @@ OLECHAR * prgchFontVar, int ichMax, int * pich, int * pichMin, int * pichLim) { - *pich = wcslen(m_rgchFontVar); - if (ichMax < *pich) - return kresFalse; - - memset(prgchFontVar, 0, isizeof(m_rgchFontVar)); - memcpy(prgchFontVar, m_rgchFontVar, isizeof(m_rgchFontVar)); - - *pichMin = 0; - *pichLim = m_cchLength; - + *pich = 0; return kresOk; } @@ -94,10 +79,3 @@ void GrTextSrc::DeleteTextSrcPtr() { } - - - -void GrTextSrc::SetColor(int clr) -{ - m_chrp.clrFore = clr; -} \ No newline at end of file Index: GrTextSrc.h =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/HelloWorld/GrTextSrc.h,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -d -r1.3 -r1.3.2.1 --- GrTextSrc.h 6 Oct 2004 18:28:23 -0000 1.3 +++ GrTextSrc.h 27 Oct 2004 14:31:50 -0000 1.3.2.1 @@ -20,8 +20,7 @@ class GrTextSrc : public IGrTextSource { public: - GrTextSrc(utf16 * pszText, GrCharProps & chrp, - utf16 * prgchFontVar, int ichFontVar); + GrTextSrc(OLECHAR * pszText); ~GrTextSrc(); virtual GrResult Fetch(int ichMin, int ichLim, OLECHAR * prgchBuf); @@ -36,18 +35,58 @@ virtual void TextSrcObject(IGrTextSource ** ppgts); virtual void DeleteTextSrcPtr(); - void SetColor(int clr); - void SetRtl(bool fRtl, int nDirDepth) + //void SetColor(int clr) + //{ + //} + //void SetRtl(bool fRtl, int nDirDepth) + //{ + //} + + // ------------------------------------------------------------------------------- + // New interface: + virtual GrResult getFaceName(int ich, unsigned int cchMax, + gr::utf16 * prgchFaceName, unsigned int * pcchLen) { - m_chrp.fWsRtl = fRtl; - m_chrp.nDirDepth = nDirDepth; + if (cchMax < 23) + return kresFail; + wcscpy(prgchFaceName, L"SILDoulos PigLatinDemo"); + return kresOk; + } + virtual float getFontSize(int ich) { return 24.0; } + virtual bool getBold(int ich) { return false; } + virtual bool getItalic(int ich) { return false; } + virtual bool getRightToLeft(int ich) { return false; } + virtual unsigned int getDirectionDepth(int ich) { return 0; } + virtual float getVerticalOffset(int ich) { return 0; } + + virtual void getRunRange(int ich, int * pichMin, int * pichLim) + { + *pichMin = 0; + *pichLim = m_cchLength; + } + + virtual GrResult getFontFeatures(int ich, int cMax, + FeatureSetting * prgfset, int * pcfset) + { + *pcfset = 0; + return kresOk; + } + + virtual bool sameSegment(int ich1, int ich2) + { + return true; + } + + // Temporary--eventually these properties will be of interest only to SegmentPainter. + virtual void getColors(int ich, int * pclrFore, int * pclrBack) + { + *pclrFore = RGB(0, 0, 0); // black + *pclrBack = RGB(255, 255, 255); // white } protected: utf16 * m_prgchText; int m_cchLength; - OLECHAR m_rgchFontVar[64]; - GrCharProps m_chrp; }; #endif Index: HelloWorld.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/HelloWorld/HelloWorld.cpp,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -u -d -r1.8 -r1.8.2.1 --- HelloWorld.cpp 6 Oct 2004 18:28:23 -0000 1.8 +++ HelloWorld.cpp 27 Oct 2004 14:31:57 -0000 1.8.2.1 @@ -160,6 +160,7 @@ MessageBox(hWnd, "GrGraphics didn't initialize", "", MB_OK); pgrfx->SetFont(hFont); + // TODO: remove GrCharProps when GrGraphics no longer needs it GrCharProps * pchrp = new GrCharProps(); memset(pchrp, '\0', sizeof(GrCharProps)); pchrp->dympHeight = 24000; // font size in millipoints @@ -168,7 +169,7 @@ pchrp->clrFore = RGB(0, 0, 0); //black pgrfx->SetupGraphics(pchrp); GrTextSrc * pgrtext; - pgrtext = new GrTextSrc(L"Hello World!", *pchrp, L"", 0); + pgrtext = new GrTextSrc(L"Hello World!"); GrSegment * pgrseg; int cchSeg; // how many characters fit in the segment int dxWidth; // width of resulting segment |
From: <sil...@li...> - 2004-10-27 14:32:45
|
Update of /cvsroot/silgraphite/silgraphite/src/GrCompiler In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11188/src/GrCompiler Modified Files: Tag: v2api Grp.h GrpParserDebug.cpp Log Message: Synchronized with FW changelist #12044: began ITextSource rework Index: Grp.h =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrCompiler/Grp.h,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -u -d -r1.7 -r1.7.2.1 --- Grp.h 22 Jul 2004 11:43:25 -0000 1.7 +++ Grp.h 27 Oct 2004 14:32:00 -0000 1.7.2.1 @@ -19,6 +19,8 @@ ////#include <cassert> #ifdef GR_FW +namespace gr { +}; #include "Common.h" #else #include "GrCommon.h" Index: GrpParserDebug.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrCompiler/GrpParserDebug.cpp,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -u -d -r1.5 -r1.5.2.1 --- GrpParserDebug.cpp 22 Jul 2004 11:43:25 -0000 1.5 +++ GrpParserDebug.cpp 27 Oct 2004 14:32:00 -0000 1.5.2.1 @@ -14,7 +14,9 @@ #include "Grp.h" #include "GrPlatform.h" +#ifndef GR_FW #include "Platform.h" +#endif #pragma hdrstop #undef THIS_FILE |
From: <sil...@li...> - 2004-10-27 14:32:45
|
Update of /cvsroot/silgraphite/silgraphite/contrib/applib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11188/contrib/applib Modified Files: Tag: v2api GrTextSrc.cpp GrTextSrc.h Log Message: Synchronized with FW changelist #12044: began ITextSource rework Index: GrTextSrc.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/applib/GrTextSrc.cpp,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -d -r1.3 -r1.3.2.1 --- GrTextSrc.cpp 6 Oct 2004 18:28:29 -0000 1.3 +++ GrTextSrc.cpp 27 Oct 2004 14:31:59 -0000 1.3.2.1 @@ -15,18 +15,36 @@ #include "GrClient.h" #include "GrTextSrc.h" -GrTextSrc::GrTextSrc(OLECHAR * pszText, GrCharProps & chrp, - OLECHAR * prgchFontVar, int ichFontVar) +GrTextSrc::GrTextSrc(utf16 * pszText, utf16 * szFaceName, int pointSize, + bool fBold, bool fItalic, + bool fRtl, int vertOffset, + int clrFore, int clrBack, + int cfid, int * rgfid, int * rgfval) { m_cchLength = (int)wcslen(pszText); m_prgchText = new OLECHAR[m_cchLength + 1]; - memcpy(m_prgchText, pszText, isizeof(OLECHAR) * m_cchLength); + memcpy(m_prgchText, pszText, isizeof(utf16) * m_cchLength); m_prgchText[m_cchLength] = L'\0'; // zero-terminate - memcpy(&m_chrp, &chrp, isizeof(GrCharProps)); - memset(m_rgchFontVar, 0, isizeof(m_rgchFontVar)); - memcpy(m_rgchFontVar, prgchFontVar, - min((unsigned int)(ichFontVar * isizeof(OLECHAR)), sizeof(m_rgchFontVar))); + size_t cchFont = wcslen((const wchar_t *)szFaceName); + memcpy(m_szFaceName, szFaceName, sizeof(utf16) * (cchFont+1)); + m_szFaceName[cchFont] = 0; // zero-terminate + + m_pointSize = pointSize; + m_fBold = fBold; + m_fItalic = fItalic; + m_fRtl = fRtl; + m_dirDepth = (m_fRtl) ? 1 : 0; + m_vertOffset = vertOffset; // in points + m_clrFore = clrFore; + m_clrBack = clrBack; + + m_cfid = cfid; + for (int ifid = 0; ifid < cfid; ifid++) + { + m_fids[ifid] = rgfid[ifid]; + m_fvals[ifid] = rgfval[ifid]; + } } GrTextSrc::~GrTextSrc() @@ -52,7 +70,17 @@ GrResult GrTextSrc::GetCharProps(int ich, GrCharProps * pchrp, int * pichMin, int * pichLim) { - memcpy(pchrp, &m_chrp, isizeof(GrCharProps)); + wcscpy(pchrp->szFaceName, m_szFaceName); + pchrp->dympHeight = m_pointSize * 1000; + pchrp->ttvBold = (byte)((m_fBold) ? kttvOn : kttvOff); + pchrp->ttvItalic = (byte)((m_fItalic) ? kttvOn : kttvOff); + pchrp->fWsRtl = m_fRtl; + + pchrp->dympOffset = m_vertOffset * 1000; + pchrp->ssv = kssvOff; // superscript + pchrp->clrFore = m_clrFore; + pchrp->clrBack = m_clrBack; + *pichMin = 0; *pichLim = m_cchLength; return kresOk; @@ -61,7 +89,6 @@ GrResult GrTextSrc::GetParaProps(int ich, LgParaRenderProps * pchrp, int * pichMin, int * pichLim) { - memset(pchrp, 0, isizeof(LgParaRenderProps)); return kresNotImpl; } @@ -69,17 +96,10 @@ OLECHAR * prgchFontVar, int ichMax, int * pich, int * pichMin, int * pichLim) { - *pich = wcslen(m_rgchFontVar); - if (ichMax < *pich) - return kresFalse; - - memset(prgchFontVar, 0, isizeof(m_rgchFontVar)); - memcpy(prgchFontVar, m_rgchFontVar, isizeof(m_rgchFontVar)); - *pichMin = 0; *pichLim = m_cchLength; - return kresOk; + return kresNotImpl; } // Return a Graphite-compatible text source that can be stored in a @@ -96,8 +116,35 @@ } +/*---------------------------------------------------------------------------------------------- + Fill in the buffer with the font face name at the given character position. + Return the number of characters needed, whether or not there is room. +----------------------------------------------------------------------------------------------*/ +GrResult GrTextSrc::getFaceName(int ich, unsigned int cchMax, + gr::utf16 * prgchFaceName, unsigned int * pcchLen) +{ + *pcchLen = (unsigned int)wcslen(m_szFaceName); + if (*pcchLen >= cchMax) + return kresFail; // insufficient room in the buffer -void GrTextSrc::SetColor(int clr) + wcscpy(prgchFaceName, m_szFaceName); // includes zero-terminator + return kresOk; +} + +/*---------------------------------------------------------------------------------------------- + Return the font features set on this text and corresponding values. +----------------------------------------------------------------------------------------------*/ +GrResult GrTextSrc::getFontFeatures(int ich, int cMax, + FeatureSetting * prgfset, int * pcfset) { - m_chrp.clrFore = clr; -} \ No newline at end of file + *pcfset = m_cfid; + if (cMax < m_cfid) + return kresFail; + + for (int ifid = 0; ifid < m_cfid; ifid++) + { + prgfset[ifid].id = m_fids[ifid]; + prgfset[ifid].value = m_fvals[ifid]; + } + return kresOk; +} Index: GrTextSrc.h =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/applib/GrTextSrc.h,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -d -r1.3 -r1.3.2.1 --- GrTextSrc.h 6 Oct 2004 18:28:29 -0000 1.3 +++ GrTextSrc.h 27 Oct 2004 14:31:59 -0000 1.3.2.1 @@ -20,8 +20,11 @@ class GrTextSrc : public IGrTextSource { public: - GrTextSrc(utf16 * pszText, GrCharProps & chrp, - utf16 * prgchFontVar, int ichFontVar); + GrTextSrc(utf16 * pszText, utf16 * szFaceName, int pointSize, + bool fBold = false, bool fItalic = false, + bool fRtl = false, int vertOffset = 0, + int clrFore = kclrBlack, int clrBack = kclrTransparent, + int cfid = 0, int * rgfid = NULL, int * rgfval = NULL); ~GrTextSrc(); virtual GrResult Fetch(int ichMin, int ichLim, OLECHAR * prgchBuf); @@ -31,23 +34,70 @@ virtual GrResult GetParaProps(int ich, LgParaRenderProps * pchrp, int * pichMin, int * pichLim); virtual GrResult GetFontVariations(int ich, - utf16 * prgchFontVar, int ichMax, int * pich, + utf16 * prgchFontVar, int ichMax, int * pcch, int * pichMin, int * pichLim); virtual void TextSrcObject(IGrTextSource ** ppgts); virtual void DeleteTextSrcPtr(); - void SetColor(int clr); - void SetRtl(bool fRtl, int nDirDepth) + void SetColor(int clr) // used in JustTestApp for automatic coloring { - m_chrp.fWsRtl = fRtl; - m_chrp.nDirDepth = nDirDepth; + m_clrFore = clr; + } + void SetRtl(bool fRtl, int nDirDepth) // used in Uniscribe Wrapper + { + m_fRtl = fRtl; + m_dirDepth = nDirDepth; + } + + // ------------------------------------------------------------------------------- + // New interface: + virtual GrResult getFaceName(int ich, unsigned int cchMax, + gr::utf16 * prgchFaceName, unsigned int * pcchLen); + virtual float getFontSize(int ich) { return (float)m_pointSize; } + virtual bool getBold(int ich) { return m_fBold; } + virtual bool getItalic(int ich) { return m_fItalic; } + virtual bool getRightToLeft(int ich) { return m_fRtl; } + virtual unsigned int getDirectionDepth(int ich) { return m_dirDepth; } + virtual float getVerticalOffset(int ich) { return (float)m_vertOffset; } + + virtual void getRunRange(int ich, int * pichMin, int * pichLim) + { + *pichMin = 0; + *pichLim = m_cchLength; + } + + virtual GrResult getFontFeatures(int ich, int cMax, + FeatureSetting * prgfset, int * pcfset); + + virtual bool sameSegment(int ich1, int ich2) + { + return true; + } + + // Temporary--eventually these properties will be of interest only to SegmentPainter. + virtual void getColors(int ich, int * pclrFore, int * pclrBack) + { + *pclrFore = m_clrFore; + *pclrBack = m_clrBack; } protected: utf16 * m_prgchText; int m_cchLength; - OLECHAR m_rgchFontVar[64]; - GrCharProps m_chrp; + + utf16 m_szFaceName[32]; + int m_pointSize; + bool m_fBold; + bool m_fItalic; + bool m_fRtl; + int m_dirDepth; + int m_vertOffset; // in points + int m_clrFore; + int m_clrBack; + + int m_cfid; // number of features + int m_fids[16]; // up to 16 features + int m_fvals[16]; }; #endif |
From: <sil...@li...> - 2004-10-27 14:32:45
|
Update of /cvsroot/silgraphite/silgraphite/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11188/include Modified Files: Tag: v2api GrEngine.h GrStructs.h IGrTextSource.h Log Message: Synchronized with FW changelist #12044: began ITextSource rework Index: GrEngine.h =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/include/GrEngine.h,v retrieving revision 1.22 retrieving revision 1.22.2.1 diff -u -d -r1.22 -r1.22.2.1 --- GrEngine.h 6 Oct 2004 18:28:30 -0000 1.22 +++ GrEngine.h 27 Oct 2004 14:32:00 -0000 1.22.2.1 @@ -29,6 +29,7 @@ class IGrJustifier; class GrSegment; + /*---------------------------------------------------------------------------------------------- The TableBuffer manages a Font table loaded into memory, hiding wether or not the table's memory is managed by the client or by GrEngine and making sure it is deleted at @@ -134,7 +135,7 @@ int cchMax, OLECHAR * rgchw, int * pcch); // IRenderEngine methods: - GrResult InitRenderer(IGrGraphics * pvg, OLECHAR * prgchData, int cchData); + GrResult InitRenderer(IGrGraphics * pgg, OLECHAR * prgchData, int cchData); GrResult FontIsValid(OLECHAR * prgchwErrMsg, int cchMaxErrMsg); GrResult get_SegDatMaxLength(int * pcb); @@ -210,6 +211,10 @@ int * pdichwContext, OLECHAR * prgchwErrMsg, int cchwMaxErrMsg); + // NEW interface + + GrResult InitRenderer_New(IGrGraphics * pgg, int cFeat, FeatureSetting * prgfset); + // Other public methods GrResult FindBreakPointAux(IGrGraphics * pgg, IGrTextSource * pgts, IGrJustifier * pgjus, @@ -401,17 +406,34 @@ This is identical to the built-in MulDiv function except that it rounds with better precision. ----------------------------------------------------------------------------------------------*/ - inline static int GrMulDiv(const int v, const int n, const int d) { + inline static int GrMulDiv(const int v, const int n, const int d) + { return int(n < 0 ? double(v * n)/double(d) - 0.5 : double(v * n)/double(d) + 0.5); } + //static void ZapFontCache() // FONT CACHE + //{ + // if (s_pFontCache) + // { + // s_pFontCache->AssertEmpty(); + // delete s_pFontCache; + // } + // s_pFontCache = NULL; + //} + protected: + // Static variable: + //static FontCache * s_pFontCache; // FONT CACHE + // Member variables: - long m_cref; + long m_cref; //////////// Font information //////////// + bool m_fBold; + bool m_fItalic; + std::wstring m_stuInitialize; // string used to initialize the engine // do we have the capacity to perform smart rendering for the various styles? @@ -569,7 +591,8 @@ GrResult ReadFromGraphicsFont(IGrGraphics * pgg, bool fItalic); void DestroyEverything(); - void AdjustFontAndStyles(IGrGraphics * pgg, std::wstring & stuFaceName, GrCharProps * pchrp); + void AdjustFontAndStyles(IGrGraphics * pgg, IGrTextSource * pgts, int ichwMin, + std::wstring & stuFaceName, GrCharProps * pchrp); bool CheckTableVersions(GrIStream * pgrstrm, byte *silf_tbl, int lSilfStart, byte *gloc_tbl, int lGlocStart, @@ -586,6 +609,9 @@ gid16 MapToPseudo(int nUnicode); + // NEW interface + void AssignDefaultFeatures(int cfeat, FeatureSetting * prgfset); + //:Ignore #ifdef OLD_TEST_STUFF // For test procedures: Index: GrStructs.h =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/include/GrStructs.h,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -d -r1.1 -r1.1.2.1 --- GrStructs.h 6 Oct 2004 18:28:30 -0000 1.1 +++ GrStructs.h 27 Oct 2004 14:32:00 -0000 1.1.2.1 @@ -41,6 +41,12 @@ wchar_t szFontVar[ 64 ]; } GrCharProps; +// Used to pass feature information among the Graphite engine and the application. +typedef struct tagFeatureSetting +{ + int id; + int value; +} FeatureSetting; } // namespace gr Index: IGrTextSource.h =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/include/IGrTextSource.h,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -u -d -r1.7 -r1.7.2.1 --- IGrTextSource.h 6 Oct 2004 18:28:30 -0000 1.7 +++ IGrTextSource.h 27 Oct 2004 14:32:00 -0000 1.7.2.1 @@ -52,6 +52,27 @@ // When a segment is being destroyed, clean up the text source inside it. virtual void DeleteTextSrcPtr() = 0; + + + // ------------------------------------------------------------------------------------ + // New interface: + virtual GrResult getFaceName(int ich, unsigned int cchMax, + gr::utf16 * prgchFaceName, unsigned int * pcchLen) = 0; + virtual float getFontSize(int ich) = 0; + virtual bool getBold(int ich) = 0; + virtual bool getItalic(int ich) = 0; + virtual bool getRightToLeft(int ich) = 0; + virtual unsigned int getDirectionDepth(int ich) = 0; + virtual float getVerticalOffset(int ich) = 0; + + virtual void getRunRange(int ich, int * pichMin, int * pichLim) = 0; + virtual GrResult getFontFeatures(int ich, int cMax, + FeatureSetting * prgfset, int * pcfset) = 0; + virtual bool sameSegment(int ich1, int ich2) = 0; + + // Temporary--eventually these will be of interest only to SegmentPainter. + virtual void getColors(int ich, int * pclrFore, int * pclrBack) = 0; + }; } // namespace gr |
From: <sil...@li...> - 2004-10-27 14:32:38
|
Update of /cvsroot/silgraphite/silgraphite/contrib/SimpleEdit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11188/contrib/SimpleEdit Modified Files: Tag: v2api SimpleEdit.cpp Log Message: Synchronized with FW changelist #12044: began ITextSource rework Index: SimpleEdit.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/SimpleEdit/SimpleEdit.cpp,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -u -d -r1.9 -r1.9.2.1 --- SimpleEdit.cpp 6 Oct 2004 18:28:29 -0000 1.9 +++ SimpleEdit.cpp 27 Oct 2004 14:31:58 -0000 1.9.2.1 @@ -25,7 +25,7 @@ // keep this data between events // note that dc and GrGraphics should not be kept between events LOGFONT g_lf; -GrCharProps g_lgchrp; +GrCharProps g_lgchrp; // TODO: get rid of this when GrGraphics no longer needs it GrTextSrc * g_pgrtext; RECT g_rSrc; RECT g_rDst; @@ -465,13 +465,13 @@ //strcpy(g_lf.lfFaceName, "Doulos SIL"); strcpy(g_lf.lfFaceName, "SILDoulos PigLatinDemo"); - memset(&g_lgchrp, '\0', sizeof(GrCharProps)); - g_lgchrp.dympHeight = 24000; // font size in millipoints wcscpy(g_lgchrp.szFaceName, L"SILDoulos PigLatinDemo"); + g_lgchrp.dympHeight = 24000; g_lgchrp.clrBack = RGB(255, 255, 255); //white g_lgchrp.clrFore = RGB(0, 0, 0); //black - g_pgrtext = new GrTextSrc(g_szString, g_lgchrp, L"", 0); + g_pgrtext = new GrTextSrc(g_szString, g_lgchrp.szFaceName, g_lgchrp.dympHeight / 1000, + g_lgchrp.ttvBold != kttvOff, g_lgchrp.ttvItalic != kttvOff); g_rSrc.top = -30; g_rSrc.left = -30; @@ -534,5 +534,6 @@ g_pgrseg = NULL; if (g_pgrtext) delete g_pgrtext; - g_pgrtext = new GrTextSrc(g_szString, g_lgchrp, L"", 0); + g_pgrtext = new GrTextSrc(g_szString, g_lgchrp.szFaceName, g_lgchrp.dympHeight/1000, + g_lgchrp.ttvBold != kttvOff, g_lgchrp.ttvItalic != kttvOff); } |
From: <sil...@li...> - 2004-10-27 14:32:38
|
Update of /cvsroot/silgraphite/silgraphite/contrib/JustTestApp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11188/contrib/JustTestApp Modified Files: Tag: v2api JustTestApp.cpp Log Message: Synchronized with FW changelist #12044: began ITextSource rework Index: JustTestApp.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/JustTestApp/JustTestApp.cpp,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -d -r1.6 -r1.6.2.1 --- JustTestApp.cpp 6 Oct 2004 18:28:28 -0000 1.6 +++ JustTestApp.cpp 27 Oct 2004 14:31:58 -0000 1.6.2.1 @@ -27,7 +27,7 @@ // keep this data between events // note that dc and GrGraphics should not be kept between events LOGFONT g_lf; -GrCharProps g_lgchrp; +GrCharProps g_lgchrp; // TODO: get rid of this when GrGraphics no longer needs it RECT g_rSrc; RECT g_rDst; @@ -602,7 +602,8 @@ { for (int i = 0; i < NUMSEGMENTS; i++) { g_lgchrp.dympHeight = g_vdympSizes[i]; - g_vpgrtext[i] = new GrTextSrc(g_szString, g_lgchrp, L"", 0); + g_vpgrtext[i] = new GrTextSrc(g_szString, g_lgchrp.szFaceName, g_lgchrp.dympHeight/1000, + g_lgchrp.ttvBold != kttvOff, g_lgchrp.ttvItalic != kttvOff); } } g_rSrc.top = -TOPMARGIN; @@ -671,7 +672,8 @@ delete g_vpgrtext[iseg]; g_lgchrp.dympHeight = g_vdympSizes[iseg]; - g_vpgrtext[iseg] = new GrTextSrc(g_szString, g_lgchrp, L"", 0); + g_vpgrtext[iseg] = new GrTextSrc(g_szString, g_lgchrp.szFaceName, g_lgchrp.dympHeight/1000, + g_lgchrp.ttvBold != kttvOff, g_lgchrp.ttvItalic != kttvOff); } g_fEngErrMsg = true; } \ No newline at end of file |
From: <sil...@li...> - 2004-10-27 14:32:14
|
Update of /cvsroot/silgraphite/silgraphite/src/GrEngine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11188/src/GrEngine Modified Files: Tag: v2api GrCharStream.cpp GrCharStream.h GrEngine.cpp GrPass.cpp GrSegment.cpp GrSlotState.cpp GrSlotState.h GrSlotStream.cpp GrTableManager.cpp GrTableManager.h TransductionLog.cpp Log Message: Synchronized with FW changelist #12044: began ITextSource rework Index: GrCharStream.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrCharStream.cpp,v retrieving revision 1.14 retrieving revision 1.14.2.1 diff -u -d -r1.14 -r1.14.2.1 --- GrCharStream.cpp 6 Oct 2004 18:28:31 -0000 1.14 +++ GrCharStream.cpp 27 Oct 2004 14:32:00 -0000 1.14.2.1 @@ -70,9 +70,11 @@ @param pichwSegOffset - index of this character from the beginning of the segment @param pcchw16bit - number of 16-bit chars consumed to get one complete Unicode codepoint. + + TODO: possibly use a little structure, if we need more properties than color. ----------------------------------------------------------------------------------------------*/ int GrCharStream::NextGet(GrTableManager * ptman, - GrFeatureValues * pfval, GrCharProps ** ppchrp, int * pichwSegOffset, + GrFeatureValues * pfval, int * pclrFore, int * pclrBack, int * pichwSegOffset, int * pcchw16bit) { GrResult res; @@ -89,12 +91,13 @@ { // Get the next run of characters - res = m_pgts->GetCharProps(m_ichwPos, &m_chrpRun, &m_ichwRunMin, &m_ichwRunLim); - if (ResultFailed(res)) - { - THROW(res); - return 0; - } + m_pgts->getRunRange(m_ichwPos, &m_ichwRunMin, &m_ichwRunLim); + //res = m_pgts->GetCharProps(m_ichwPos, &m_chrpRun, &m_ichwRunMin, &m_ichwRunLim); + //if (ResultFailed(res)) + //{ + // THROW(res); + // return 0; + //} // The only time the run extends before what we want is on the first run. Assert((m_ichwRunMin == m_ichwPos) // m_ichwPos is beginning of run @@ -163,7 +166,7 @@ int nRet = m_prgnRunText[m_inRunOffset]; *pfval = m_fvalRunFeats; - *ppchrp = &m_chrpRun; + m_pgts->getColors(m_ichwPos, pclrFore, pclrBack); *pichwSegOffset = m_ichwPos - m_ichwMin; // offset from the official start of the segment // of the first 16-bit char int ichwPosPrev = m_ichwPos; @@ -250,29 +253,22 @@ ----------------------------------------------------------------------------------------------*/ bool GrCharStream::AtUnicodeCharBoundary(IGrTextSource * pgts, int ichw) { - int ichwRunMin, ichwRunLim, cchw; + int cchw; GrResult res = pgts->get_Length(&cchw); if (ichw <= 0 || ichw >= cchw) return true; - GrCharProps chrp; - res = pgts->GetCharProps(ichw, &chrp, &ichwRunMin, &ichwRunLim); - if (ResultFailed(res)) - { - THROW(res); - return true; - } - utf16 * prgchwRunText = new utf16[ichwRunLim - ichwRunMin]; - res = pgts->Fetch(ichwRunMin, ichwRunLim, prgchwRunText); + int ichMinGet = max(0, ichw - 1); + int ichLimGet = ichw + 1; + utf16 rgchText[3]; // never need more than a handful of characters + res = pgts->Fetch(ichMinGet, ichLimGet, rgchText); if (ResultFailed(res)) { - delete[] prgchwRunText; THROW(res); return true; } - bool fRet = AtUnicodeCharBoundary(prgchwRunText, ichwRunLim - ichwRunMin, - ichw - ichwRunMin); - delete[] prgchwRunText; + bool fRet = AtUnicodeCharBoundary(rgchText, ichLimGet - ichMinGet, + ichw - ichMinGet); return fRet; } @@ -336,9 +332,12 @@ /*---------------------------------------------------------------------------------------------- Get the current feature values and character properties from the stream. + + TODO: possibly create a little structure, if we end up needing more properties than + color. ----------------------------------------------------------------------------------------------*/ void GrCharStream::CurrentFeatures(GrTableManager * ptman, - GrFeatureValues * pfval, GrCharProps ** ppchrp) + GrFeatureValues * pfval, int * pclrFore, int * pclrBack) { if (m_ichwRunOffset == kPosInfinity) { @@ -357,7 +356,7 @@ int inRunOffsetSave = m_inRunOffset; int cMapSize = m_vislotNextChunkMap.size(); int cchwConsumed; - int nChar = NextGet(ptman, pfval, ppchrp, &ichwSegOffset, &cchwConsumed); + int nChar = NextGet(ptman, pfval, pclrFore, pclrBack, &ichwSegOffset, &cchwConsumed); // Put the character back. m_ichwPos = ichwPosSave; m_ichwRunOffset = ichwRunOffsetSave; @@ -368,7 +367,8 @@ else { *pfval = m_fvalRunFeats; - *ppchrp = &m_chrpRun; + //*ppchrp = &m_chrpRun; + m_pgts->getColors(m_ichwPos, pclrFore, pclrBack); } } @@ -387,44 +387,57 @@ m_fvalRunFeats.m_nStyleIndex = 0; - // The engine was initialized with features from the old writing system. - // First do the string that is in m_chrpRun, because that has any features that - // are part of the string's style. + int cfeat; + FeatureSetting rgfset[kMaxFeatures]; + GrResult res = m_pgts->getFontFeatures(ichw, kMaxFeatures, rgfset, &cfeat); + Assert(res == kresOk); // because we passed kMaxFeatures; - std::wstring stuFromStyle(m_chrpRun.szFontVar); - ParseFeatureString(NULL, ptman, this, stuFromStyle, false); + for (int ifeatLp = 0; ifeatLp < cfeat; ifeatLp++) + { + int ifeat; + ptman->FeatureWithID(rgfset[ifeatLp].id, &ifeat); + if (ifeat >= 0) + m_fvalRunFeats.m_rgnFValues[ifeat] = rgfset[ifeatLp].value; + } + // OLD CODE + // The engine was initialized with features from the writing system. + // First do the string that is in m_chrpRun, because that has any features that + // are part of the string's style. + //std::wstring stuFromStyle(m_chrpRun.szFontVar); + //ParseFeatureString(NULL, ptman, this, stuFromStyle, false); // Now do any features that are set directly on the text. + //int ichwMinBogus, ichwLimBogus; + //OLECHAR rgchwFontVar[128]; + //OLECHAR * prgchwFontVar = rgchwFontVar; + //bool fDelete = false; + //int cchFontVar; + //GrResult res = m_pgts->GetFontVariations(ichw, prgchwFontVar, 128, &cchFontVar, + // &ichwMinBogus, &ichwLimBogus); + //if (res == kresFalse) + //{ + // prgchwFontVar = new OLECHAR[cchFontVar]; + // fDelete = true; + // res = m_pgts->GetFontVariations(ichw, prgchwFontVar, cchFontVar, &cchFontVar, + // &ichwMinBogus, &ichwLimBogus); + //} + //if (ResultFailed(res)) + // // Review: should we throw an error, or just assume an empty string? + // THROW(res); - int ichwMinBogus, ichwLimBogus; - OLECHAR rgchwFontVar[128]; - OLECHAR * prgchwFontVar = rgchwFontVar; - bool fDelete = false; - int cchFontVar; - GrResult res = m_pgts->GetFontVariations(ichw, prgchwFontVar, 128, &cchFontVar, - &ichwMinBogus, &ichwLimBogus); - if (res == kresFalse) - { - prgchwFontVar = new OLECHAR[cchFontVar]; - fDelete = true; - res = m_pgts->GetFontVariations(ichw, prgchwFontVar, cchFontVar, &cchFontVar, - &ichwMinBogus, &ichwLimBogus); - } - if (ResultFailed(res)) - // Review: should we throw an error, or just assume an empty string? - THROW(res); + //std::wstring stuFromString(prgchwFontVar, cchFontVar); + //if (fDelete) + // delete[] prgchwFontVar; - std::wstring stuFromString(prgchwFontVar, cchFontVar); - if (fDelete) - delete[] prgchwFontVar; + //// Now parse the string and set the features accordingly. + //if (stuFromString != stuFromStyle) + // ParseFeatureString(NULL, ptman, this, stuFromString, false); - // Now parse the string and set the features accordingly. - if (stuFromString != stuFromStyle) - ParseFeatureString(NULL, ptman, this, stuFromString, false); // Eventually, read the style information as well and determine the style index // from it. + // Kludge for testing. Note that there are several syntax errors. //ParseFeatureString(NULL, ptman, this, "234=2,garbage==3,1 = \"xy", false); } Index: GrCharStream.h =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrCharStream.h,v retrieving revision 1.12 retrieving revision 1.12.2.1 diff -u -d -r1.12 -r1.12.2.1 --- GrCharStream.h 6 Oct 2004 18:28:31 -0000 1.12 +++ GrCharStream.h 27 Oct 2004 14:32:00 -0000 1.12.2.1 @@ -82,11 +82,11 @@ m_ichwLim = m_ichwPos; } - int NextGet(GrTableManager *, GrFeatureValues * pfval, GrCharProps ** ppchrp, + int NextGet(GrTableManager *, GrFeatureValues * pfval, int * pclrFore, int * pclrBack, int * ichwSegOffset, int * pcchw16bit); void CurrentFeatures(GrTableManager * ptman, - GrFeatureValues * pfval, GrCharProps ** ppchrp); + GrFeatureValues * pfval, int * pclrFore, int * pclrBack); // For transduction logging: int GetLogData(GrTableManager * ptman, int * rgnChars, bool * rgfNewRun, @@ -128,7 +128,7 @@ int m_inRunOffset; // index into m_prgnRunText; kPosInfinity if nothing set up int m_ichwRunOffset; // corresponding index into text source GrFeatureValues m_fvalRunFeats; - GrCharProps m_chrpRun; + //GrCharProps m_chrpRun; std::vector<int> m_vislotNextChunkMap; // maps from 16-bit chars to 32-bit chars & glyphs }; Index: GrEngine.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrEngine.cpp,v retrieving revision 1.38 retrieving revision 1.38.2.1 diff -u -d -r1.38 -r1.38.2.1 --- GrEngine.cpp 6 Oct 2004 18:28:31 -0000 1.38 +++ GrEngine.cpp 27 Oct 2004 14:32:01 -0000 1.38.2.1 @@ -27,6 +27,21 @@ namespace gr { +//:>******************************************************************************************** +//:> Forward declarations +//:>******************************************************************************************** + +//:>******************************************************************************************** +//:> Local Constants and static variables +//:>******************************************************************************************** + +//FontCache * GrEngine::s_pFontCache; // FONT CACHE + + +//:>******************************************************************************************** +//:> General functions +//:>******************************************************************************************** + bool compareCmap(const byte *lhs, const byte *rhs) { using namespace gr; @@ -71,13 +86,6 @@ } -//:>******************************************************************************************** -//:> Forward declarations -//:>******************************************************************************************** - -//:>******************************************************************************************** -//:> Local Constants and static variables -//:>******************************************************************************************** //:>******************************************************************************************** //:> Table Buffer class. @@ -129,6 +137,10 @@ void GrEngine::BasicInit() { + // FONT CACHE + //if (s_pFontCache == NULL) + // s_pFontCache = new FontCache; + m_ptman = NULL; m_pctbl = NULL; m_pgtbl = NULL; @@ -174,6 +186,9 @@ GrEngine::~GrEngine() { + // FONT CACHE + //s_pFontCache->RemoveFontFace(m_stuFaceName, m_fBold, m_fItalic); + DestroyEverything(); #ifdef _MSC_VER if (!_CrtCheckMemory()) @@ -181,7 +196,6 @@ OutputDebugString(L"bad memory"); } #endif - } /*---------------------------------------------------------------------------------------------- @@ -559,39 +573,42 @@ { ChkGrArgPtr(pchrp); - if (pchrp->ssv == kssvSuper) - { - // Superscript: offset up 40% - pchrp->dympOffset += GrMulDiv(pchrp->dympHeight, 4, 10); - // Size down 1/4 - pchrp->dympHeight -= GrMulDiv(pchrp->dympHeight, 1, 4); - pchrp->ssv = kssvOff; // Make sure no way it can happen twice! - } - else if (pchrp->ssv == kssvSub) - { - // Subscript: offset down 40% - pchrp->dympOffset -= GrMulDiv(pchrp->dympHeight, 4, 10); - // Size down 1/4 - pchrp->dympHeight -= GrMulDiv(pchrp->dympHeight, 1, 4); - pchrp->ssv = kssvOff; // Make sure no way it can happen twice! - } + Assert(wcscmp(pchrp->szFaceName, m_stuFaceName.data()) == 0); - std::wstring stuFace = m_stuFaceName; - // The calling application may very well send an empty string representing an invalid - // font. Fall back to something we expect they'll have. - if (stuFace.size() == 0) - stuFace = L"Arial"; + //if (pchrp->ssv == kssvSuper) + //{ + // // Superscript: offset up 40% + // pchrp->dympOffset += GrMulDiv(pchrp->dympHeight, 4, 10); + // // Size down 1/4 + // pchrp->dympHeight -= GrMulDiv(pchrp->dympHeight, 1, 4); + // pchrp->ssv = kssvOff; // Make sure no way it can happen twice! + //} + //else if (pchrp->ssv == kssvSub) + //{ + // // Subscript: offset down 40% + // pchrp->dympOffset -= GrMulDiv(pchrp->dympHeight, 4, 10); + // // Size down 1/4 + // pchrp->dympHeight -= GrMulDiv(pchrp->dympHeight, 1, 4); + // pchrp->ssv = kssvOff; // Make sure no way it can happen twice! + //} + + //std::wstring stuFace = m_stuFaceName; + //// The calling application may very well send an empty string representing an invalid + //// font. Fall back to something we expect they'll have. + //if (stuFace.size() == 0) + // stuFace = L"Arial"; + + //if (wcscmp(pchrp->szFaceName, L"<default serif>") == 0 || + // wcscmp(pchrp->szFaceName, L"<default sans serif>") == 0 || + // wcscmp(pchrp->szFaceName, L"<default monospace>") == 0 || + // wcscmp(pchrp->szFaceName, L"<default fixed>") == 0 || + // wcscmp(pchrp->szFaceName, L"<default font>") == 0) + //{ + // // NEVER overrun the buffer, and ensure NUL termination.. + // wcsncpy(pchrp->szFaceName, stuFace.data(), 32); + // pchrp->szFaceName[31] = 0; + //} - if (wcscmp(pchrp->szFaceName, L"<default serif>") == 0 || - wcscmp(pchrp->szFaceName, L"<default sans serif>") == 0 || - wcscmp(pchrp->szFaceName, L"<default monospace>") == 0 || - wcscmp(pchrp->szFaceName, L"<default fixed>") == 0 || - wcscmp(pchrp->szFaceName, L"<default font>") == 0) - { - // NEVER overrun the buffer, and ensure NUL termination.. - wcsncpy(pchrp->szFaceName, stuFace.data(), 32); - pchrp->szFaceName[31] = 0; - } ReturnResult(kresOk); } @@ -1297,19 +1314,21 @@ } #endif // OLD_TEST_STUFF - // Get char props for first run. - GrCharProps chrp; - int ichwMinBogus, ichwLimBogus; - GrResult res = pgts->GetCharProps(ichwMin, &chrp, &ichwMinBogus, &ichwLimBogus); - if (ResultFailed(res)) - { - WARN(kresInvalidArg); // client error: invalid data - m_fRightToLeft = false; - } - else - { - m_fRightToLeft = chrp.fWsRtl; - } + m_fRightToLeft = pgts->getRightToLeft(ichwMin); + + //// Get char props for first run. + //GrCharProps chrp; + //int ichwMinBogus, ichwLimBogus; + //GrResult res = pgts->GetCharProps(ichwMin, &chrp, &ichwMinBogus, &ichwLimBogus); + //if (ResultFailed(res)) + //{ + // WARN(kresInvalidArg); // client error: invalid data + // m_fRightToLeft = false; + //} + //else + //{ + // m_fRightToLeft = chrp.fWsRtl; + //} } /*---------------------------------------------------------------------------------------------- @@ -1336,10 +1355,14 @@ while (true) { - GrCharProps chrp; int ichwMinRun, ichwLimRun; - pgts->GetCharProps(ichwMinNext, &chrp, &ichwMinRun, &ichwLimRun); - *pnDirDepth = chrp.nDirDepth; + + //GrCharProps chrp; + //pgts->GetCharProps(ichwMinNext, &chrp, &ichwMinRun, &ichwLimRun); + //*pnDirDepth = chrp.nDirDepth; + + pgts->getRunRange(ichwMinNext, &ichwMinRun, &ichwLimRun); + *pnDirDepth = pgts->getDirectionDepth(ichwMinNext); if (ichwLim > -1 && ichwLim < ichwLimRun) { @@ -1358,23 +1381,33 @@ } else { - GrCharProps chrpNext; - int ichwMinBogus, ichwLimBogus; - pgts->GetCharProps(ichwLimRun, &chrpNext, &ichwMinBogus, &ichwLimBogus); + //GrCharProps chrpNext; + //int ichwMinBogus, ichwLimBogus; + //pgts->GetCharProps(ichwLimRun, &chrpNext, &ichwMinBogus, &ichwLimBogus); - *pfNextIsSameWs = (chrp.ws == chrpNext.ws); + utf16 szFaceName[128]; + utf16 szFaceNameNext[128]; + unsigned int cch; + pgts->getFaceName(ichwMinNext, 128, szFaceName, &cch); + pgts->getFaceName(ichwLimRun, 128, szFaceNameNext, &cch); + bool fRtl = pgts->getRightToLeft(ichwMinNext); + bool fRtlNext = pgts->getRightToLeft(ichwLimRun); + + //*pfNextIsSameWs = (chrp.ws == chrpNext.ws); + // Well, sort of; this has been dumbed down from its original behavior: + *pfNextIsSameWs = ((wcscmp(szFaceName, szFaceNameNext) == 0) && (fRtl == fRtlNext)); // If the following run is the same as this run except for color and underlining, // we don't have to break here. - if (*pfNextIsSameWs && - chrp.dympOffset == chrpNext.dympOffset && - chrp.fWsRtl == chrpNext.fWsRtl && - chrp.nDirDepth == chrpNext.nDirDepth && - chrp.ssv == chrpNext.ssv && - chrp.ttvBold == chrpNext.ttvBold && - chrp.ttvItalic == chrpNext.ttvItalic && - wcscmp(chrp.szFaceName, chrpNext.szFaceName) == 0 && - chrp.dympHeight == chrpNext.dympHeight) + if (pgts->sameSegment(ichwMinNext, ichwLimRun)) + //chrp.dympOffset == chrpNext.dympOffset && + //chrp.fWsRtl == chrpNext.fWsRtl && + //chrp.nDirDepth == chrpNext.nDirDepth && + //chrp.ssv == chrpNext.ssv && + //chrp.ttvBold == chrpNext.ttvBold && + //chrp.ttvItalic == chrpNext.ttvItalic && + //wcscmp(chrp.szFaceName, chrpNext.szFaceName) == 0 && + //chrp.dympHeight == chrpNext.dympHeight) { // don't break } @@ -1458,8 +1491,10 @@ } } //////if (stuFaceName != m_stuFaceName) - if (wcscmp(rgchFaceName, m_stuFaceName.data())) + if (wcscmp(rgchFaceName, m_stuFaceName.data()) != 0) { + //s_pFontCache->RemoveFontFace(m_stuFaceName, m_fBold, m_fItalic); // FONT CACHE + DestroyEverything(); // nothing we've cached is safe or useful. //////m_stuFaceName = stuFaceName; m_stuFaceName.assign(rgchFaceName, wcslen(rgchFaceName)); @@ -1487,6 +1522,11 @@ m_stuFeatures = stuFeatures; GrCharStream::ParseFeatureString(this, NULL, NULL, m_stuFeatures, true); + // FONT CACHE + m_fBold = fBold; + m_fItalic = fItalic; + //s_pFontCache->CacheFontFace(m_stuFaceName, m_fBold, m_fItalic, this); + return m_resFontValid; } @@ -1620,13 +1660,13 @@ { goto LCache; } - else // read cmap table from VwGraphics dc + else // read cmap table from GrGraphics dc { tbufCmapFromGfx = TableBuffer(*pgg, TtfUtil::TableIdTag(ktiCmap)); } - // Test data read from font with data read from VwGraphics; - // ie could have fallen back from bold to regular for font file but VwGraphics may contain + // Test data read from font with data read from GrGraphics; + // ie could have fallen back from bold to regular for font file but GrGraphics may contain // a real bold font that wasn't registered with Graphite. if (fSmart) { @@ -1656,7 +1696,7 @@ // memcpy(pCmap, bstrCmap, cbCmap); // ::SysFreeString(bstrCmap); - // use cmap from VwGraphics so boxes are not drawn on screen + // use cmap from GrGraphics so boxes are not drawn on screen // original m_pCmap cleaned up by DestroyContents() above m_tbufCmap = tbufCmapFromGfx; m_pCmap_3_1 = NULL; @@ -2424,14 +2464,16 @@ ----------------------------------------------------------------------------------------------*/ void GrEngine::GetStyles(IGrTextSource * pgts, int ichwMin, bool * pfBold, bool * pfItalic) { - int ichwMinBogus, ichwLimBogus; // Set the font to the one that this engine is using, regardless of what was requested. - GrCharProps chrp; - CheckHr(pgts->GetCharProps(ichwMin, &chrp, &ichwMinBogus, &ichwLimBogus)); + *pfBold = pgts->getBold(ichwMin); + *pfItalic = pgts->getItalic(ichwMin); - *pfBold = chrp.ttvBold == kttvOff ? false : true; - *pfItalic = chrp.ttvItalic == kttvOff ? false : true; + //int ichwMinBogus, ichwLimBogus; + //GrCharProps chrp; + //CheckHr(pgts->GetCharProps(ichwMin, &chrp, &ichwMinBogus, &ichwLimBogus)); + //*pfBold = chrp.ttvBold == kttvOff ? false : true; + //*pfItalic = chrp.ttvItalic == kttvOff ? false : true; } /*---------------------------------------------------------------------------------------------- @@ -2440,23 +2482,20 @@ void GrEngine::SetUpGraphics(IGrGraphics * pgg, IGrTextSource * pgts, int ichwMin, std::wstring stuFaceName) { - int ichwMinBogus, ichwLimBogus; - // Set the font to the one that this engine is using, regardless of what the // text itself requested. I.e, the font name in the chrp is virtually ignored. GrCharProps chrp; - CheckHr(pgts->GetCharProps(ichwMin, &chrp, &ichwMinBogus, &ichwLimBogus)); - AdjustFontAndStyles(pgg, stuFaceName, &chrp); + AdjustFontAndStyles(pgg, pgts, ichwMin, stuFaceName, &chrp); try { CheckHr(pgg->SetupGraphics(&chrp)); } catch(...) - { // This code is unlikely to execute since even if VwGraphics::SetupGraphics can't + { // This code is unlikely to execute since even if GrGraphics::SetupGraphics can't // find an exact font match it will make its "best guess". std::wstring stuFaceName(L"Arial"); - AdjustFontAndStyles(pgg, stuFaceName, &chrp); + AdjustFontAndStyles(pgg, pgts, ichwMin, stuFaceName, &chrp); CheckHr(pgg->SetupGraphics(&chrp)); } } @@ -2466,10 +2505,20 @@ requested. TODO: clean this up. ----------------------------------------------------------------------------------------------*/ -void GrEngine::AdjustFontAndStyles(IGrGraphics * pgg, std::wstring & stuFaceName, - GrCharProps * pchrp) +void GrEngine::AdjustFontAndStyles(IGrGraphics * pgg, IGrTextSource * pgts, + int ichwMin, std::wstring & stuFaceName, GrCharProps * pchrp) { - InterpretChrp(pchrp); + // TODO: get rid of GrCharProps when graphics object no longer needs it. + int ichMinBogus, ichLimBogus; + pgts->GetCharProps(ichwMin, pchrp, &ichMinBogus, &ichLimBogus); + + ////utf16 rgchwFace[32]; + ////for (int ich = 0; ich < 32; ich++) + //// rgchwFace[ich] = stuFaceName[ich]; + ////pgts->InterpretChrp(pchrp, rgchwFace); + + pchrp->dympHeight = (int)pgts->getFontSize(ichwMin) * 1000; + pchrp->dympOffset = (int)pgts->getVerticalOffset(ichwMin) * 1000; int yInch; pgg->get_YUnitsPerInch(&yInch); @@ -2477,10 +2526,10 @@ // The calling application may very well send an empty string representing an invalid // font. Fall back to something we expect they'll have. - if (stuFaceName.size() == 0) - stuFaceName = L"Arial"; + ////if (stuFaceName.size() == 0) + //// stuFaceName = L"Arial"; - int cchwCopy = min(signed(stuFaceName.size()) + 1, 32); + int cchwCopy = min(signed(stuFaceName.size() + 1), 32); wcsncpy(pchrp->szFaceName, stuFaceName.data(), cchwCopy); pchrp->szFaceName[31] = 0; // ensure null termination even for long path @@ -2502,12 +2551,9 @@ void GrEngine::SetUpGraphicsForDrawingColor(IGrGraphics * pgg, IGrTextSource * pgts, int ichwMin, std::wstring stuFaceName, int clrFore, int clrBack, bool fBackColor) { - int ichwMinBogus, ichwLimBogus; - // Set the font to the one that this engine is using, regardless of what was requested. GrCharProps chrp; - CheckHr(pgts->GetCharProps(ichwMin, &chrp, &ichwMinBogus, &ichwLimBogus)); - AdjustFontAndStyles(pgg, stuFaceName, &chrp); + AdjustFontAndStyles(pgg, pgts, ichwMin, stuFaceName, &chrp); chrp.clrFore = clrFore; chrp.clrBack = clrBack; @@ -3572,6 +3618,40 @@ #endif // OLD_TEST_STUFF + +//:>******************************************************************************************** +//:> New interface +//:>******************************************************************************************** +/*---------------------------------------------------------------------------------------------- + Initalize the engine, using the font in the graphics device. + Returns: + kresFalse if the font is valid but is not a Graphite font (no Silf table) + kresFail if it is not a valid font + kresOk if it is a valid Graphite font + kresUnexpected if one of the Graphite tables is invalid +----------------------------------------------------------------------------------------------*/ +GrResult GrEngine::InitRenderer_New(IGrGraphics * pgg, + int cFeat, FeatureSetting * prgfset) +{ + GrResult res = SetUp(pgg, L""); + AssignDefaultFeatures(cFeat, prgfset); + return res; +} + +/*---------------------------------------------------------------------------------------------- + Store the default features values as specified by the client. +----------------------------------------------------------------------------------------------*/ +void GrEngine::AssignDefaultFeatures(int cfeat, FeatureSetting * prgfset) +{ + for (int ifeatIn = 0; ifeatIn < cfeat; ifeatIn++) + { + int ifeat; + FeatureWithID(prgfset[ifeatIn].id, &ifeat); + if (ifeat >= 0 ) + SetDefaultForFeatureAt(ifeat, prgfset[ifeatIn].value); + } +} + } // namespace gr //:End Ignore Index: GrPass.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrPass.cpp,v retrieving revision 1.19 retrieving revision 1.19.2.1 diff -u -d -r1.19 -r1.19.2.1 --- GrPass.cpp 6 Oct 2004 18:28:31 -0000 1.19 +++ GrPass.cpp 27 Oct 2004 14:32:01 -0000 1.19.2.1 @@ -663,12 +663,15 @@ int ichwSegOffset; // offset from the official start of the segment int cchw; // number of 16-bit chars consumed GrFeatureValues fval; - GrCharProps * pchrp = NULL; - int nUnicode = pchstrm->NextGet(ptman, &fval, &pchrp, &ichwSegOffset, &cchw); + //GrCharProps * pchrp = NULL; // need clrFore, clrBack + int clrFore, clrBack; + int nUnicode = pchstrm->NextGet(ptman, &fval, &clrFore, &clrBack, + &ichwSegOffset, &cchw); gid16 chwGlyphID = ptman->GetGlyphIDFromUnicode(nUnicode); GrSlotState * pslotNew; - ptman->State()->NewSlot(chwGlyphID, fval, pchrp, 0, ichwSegOffset, nUnicode, &pslotNew); + ptman->State()->NewSlot(chwGlyphID, fval, clrFore, clrBack, + 0, ichwSegOffset, nUnicode, &pslotNew); psstrmOut->NextPut(pslotNew); psstrmOut->MapInputChunk(islotChunkI, islotChunkO, pchstrm->SegOffset(), false, false); Index: GrSegment.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrSegment.cpp,v retrieving revision 1.27 retrieving revision 1.27.2.1 diff -u -d -r1.27 -r1.27.2.1 --- GrSegment.cpp 6 Oct 2004 18:28:31 -0000 1.27 +++ GrSegment.cpp 27 Oct 2004 14:32:01 -0000 1.27.2.1 @@ -551,8 +551,6 @@ { ChkGrOutPtr(pfResult); - GrResult res; - if (m_twsh == ktwshOnlyWs) { // White-space-only segment: use main paragraph direction. @@ -568,14 +566,17 @@ } // Get char props for first run. - GrCharProps chrp; - int ichwMinBogus, ichwLimBogus; - res = m_pgts->GetCharProps(ichwBase, &chrp, &ichwMinBogus, &ichwLimBogus); - if (ResultSucceeded(res)) - { - *pfResult = chrp.fWsRtl; - ReturnResult(res); - } + //GrResult res; + //GrCharProps chrp; + //int ichwMinBogus, ichwLimBogus; + //res = m_pgts->GetCharProps(ichwBase, &chrp, &ichwMinBogus, &ichwLimBogus); + //if (ResultSucceeded(res)) + //{ + // *pfResult = chrp.fWsRtl; + // ReturnResult(res); + //} + + *pfResult = m_pgts->getRightToLeft(ichwBase); *pfResult = false; THROW(kresUnexpected); @@ -595,13 +596,7 @@ *pnDepth = m_nDirDepth; *pfWeak = (m_twsh == ktwshOnlyWs); - // Get char props for first run. -// GrResult res; -// GrCharProps chrp; -// int ichwMinBogus, ichwLimBogus; -// if (ResultFailed(res = m_pgts->GetCharProps(ichwBase, &chrp, &ichwMinBogus, &ichwLimBogus))) -// return WARN(res); -// *pnDepth = chrp.nDirDepth; +// *pnDepth = m_pgts->getDirectionDepth(ichwBase); // Assert(*pnDepth == m_nDirDepth); // *pfWeak = false; Index: GrSlotState.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrSlotState.cpp,v retrieving revision 1.16 retrieving revision 1.16.2.1 diff -u -d -r1.16 -r1.16.2.1 --- GrSlotState.cpp 6 Oct 2004 18:28:31 -0000 1.16 +++ GrSlotState.cpp 27 Oct 2004 14:32:02 -0000 1.16.2.1 @@ -41,7 +41,7 @@ ----------------------------------------------------------------------------------------------*/ // standard for pass 0 slots void GrSlotState::Initialize(int chw, GrEngine * pgreng, - GrFeatureValues fval, GrCharProps * pchrp, + GrFeatureValues fval, int clrFore, int clrBack, int ipass, int ichwSegOffset, int nUnicode) { Assert(ipass == 0); @@ -53,12 +53,11 @@ memset(PCompRefBuf(), 0, (isizeof(void *) * m_cnCompPerLig)); memset(PSlatiBuf(), 0, (isizeof(void *) * m_cnCompPerLig)); memcpy(PFeatureBuf(), fval.m_rgnFValues, (isizeof(int) * m_cnFeat)); - if (pchrp) - { - m_clrFore = pchrp->clrFore; - m_clrBack = pchrp->clrBack; - //m_fUnderline = pchrp->fUnderline; - } + + m_clrFore = clrFore; + m_clrBack = clrBack; + //m_fUnderline = ... + m_ipassModified = ipass; m_ichwSegOffset = ichwSegOffset; m_nUnicode = nUnicode; Index: GrSlotState.h =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrSlotState.h,v retrieving revision 1.14 retrieving revision 1.14.2.1 diff -u -d -r1.14 -r1.14.2.1 --- GrSlotState.h 6 Oct 2004 18:28:31 -0000 1.14 +++ GrSlotState.h 27 Oct 2004 14:32:02 -0000 1.14.2.1 @@ -409,7 +409,7 @@ { } - void Initialize(int chw, GrEngine *, GrFeatureValues fval, GrCharProps * pchrp, + void Initialize(int chw, GrEngine *, GrFeatureValues fval, int clrFore, int clrBack, int ipass, int ichwSegOffset, int nUnicode = -1); void Initialize(int chw, GrEngine *, GrSlotState * pslotFeat, int ipass, int ichwSegOffset); Index: GrSlotStream.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrSlotStream.cpp,v retrieving revision 1.18 retrieving revision 1.18.2.1 diff -u -d -r1.18 -r1.18.2.1 --- GrSlotStream.cpp 6 Oct 2004 18:28:31 -0000 1.18 +++ GrSlotStream.cpp 27 Oct 2004 14:32:02 -0000 1.18.2.1 @@ -1566,8 +1566,10 @@ { GrFeatureValues fval; GrCharProps * pchrp = NULL; - pchstrm->CurrentFeatures(ptman, &fval, &pchrp); - pengst->NewSlot(ptman->LBGlyphID(), fval, pchrp, 0, ichwSegOffset, -1, &pslotNew); + int clrFore, clrBack; + pchstrm->CurrentFeatures(ptman, &fval, &clrFore, &clrBack); + pengst->NewSlot(ptman->LBGlyphID(), fval, clrFore, clrBack, + 0, ichwSegOffset, -1, &pslotNew); } pslotNew->m_lb = lb; Index: GrTableManager.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrTableManager.cpp,v retrieving revision 1.23 retrieving revision 1.23.2.1 diff -u -d -r1.23 -r1.23.2.1 --- GrTableManager.cpp 6 Oct 2004 18:28:31 -0000 1.23 +++ GrTableManager.cpp 27 Oct 2004 14:32:02 -0000 1.23.2.1 @@ -102,10 +102,13 @@ delete[] m_prgzpst; - for (int isstrm = 0; isstrm < m_cpass; ++isstrm) - delete OutputStream(isstrm); + if (m_prgpsstrm) + { + for (int isstrm = 0; isstrm < m_cpass; ++isstrm) + delete OutputStream(isstrm); - delete[] m_prgpsstrm; + delete[] m_prgpsstrm; + } } /*---------------------------------------------------------------------------------------------- @@ -336,7 +339,7 @@ int cbNextMax, byte * pbNextSegDat, int * pcbNextSegDat, int * pdichwContext) { - m_engst.Initialize(Engine(), this); // do this after the tables have be fully read + m_engst.Initialize(Engine(), this); // do this after the tables have been fully read m_engst.m_jmodi = jmodi; m_engst.m_ipassJustCalled = -1; m_engst.m_twsh = twsh; @@ -1696,12 +1699,13 @@ // standard for pass 0 slots void EngineState::NewSlot( - int gID, GrFeatureValues fval, GrCharProps * pchrp, + int gID, GrFeatureValues fval, int clrFore, int clrBack, int ipass, int ichwSegOffset, int nUnicode, GrSlotState ** ppslotRet) { NextSlot(ppslotRet); - (*ppslotRet)->Initialize(gID, Engine(), fval, pchrp, ipass, ichwSegOffset, nUnicode); + (*ppslotRet)->Initialize(gID, Engine(), fval, clrFore, clrBack, + ipass, ichwSegOffset, nUnicode); } // line-break slots Index: GrTableManager.h =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrTableManager.h,v retrieving revision 1.16 retrieving revision 1.16.2.1 diff -u -d -r1.16 -r1.16.2.1 --- GrTableManager.h 6 Oct 2004 18:28:31 -0000 1.16 +++ GrTableManager.h 27 Oct 2004 14:32:03 -0000 1.16.2.1 @@ -199,7 +199,7 @@ GrSlotState ** ppslotLast, GrSlotState ** ppslotLastBase); // Memory management for slots: - void NewSlot(int gID, GrFeatureValues fval, GrCharProps * pchrp, + void NewSlot(int gID, GrFeatureValues fval, int clrFore, int clrBack, int ipass, int ichwSegOffset, int nUnicode, GrSlotState **); void NewSlot(int gID, GrSlotState * pslotFeat, int ipass, int ichwSegOffset, @@ -453,6 +453,7 @@ #ifdef TRACING void WriteXductnLog(std::ofstream & strmOut, GrCharStream * pchstrm, GrSegment * psegRet, int cbPrevSegDat, byte * pbPrevSegDat); + bool LogFileName(std::string & staFile); void LogUnderlying(std::ofstream & strmOut, GrCharStream * pchstrm, int cchwBackup); void LogPass1Input(std::ofstream & strmOut); void LogPassOutput(std::ofstream & strmOut, int ipass, int cslotSkipped); Index: TransductionLog.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/TransductionLog.cpp,v retrieving revision 1.15 retrieving revision 1.15.2.1 diff -u -d -r1.15 -r1.15.2.1 --- TransductionLog.cpp 6 Oct 2004 18:28:32 -0000 1.15 +++ TransductionLog.cpp 27 Oct 2004 14:32:03 -0000 1.15.2.1 @@ -49,18 +49,10 @@ int cbPrevSegDat, byte * pbPrevSegDat, byte * pbNextSegDat, int * pcbNextSegDat) { #ifdef TRACING - // The log goes in the directory defined by either the TEMP or TMP environment variable. - char * pchTmpEnv = getenv("TEMP"); - if (pchTmpEnv == 0) - pchTmpEnv = getenv("TMP"); - if (pchTmpEnv == 0) + std::string staFile; + if (!LogFileName(staFile)) return false; - std::string staFile(pchTmpEnv); - if (staFile[staFile.size() - 1] != '\\') - staFile.append("\\"); - staFile.append("gr_xductn.log"); - std::ofstream strmOut; if (cbPrevSegDat > 0) strmOut.open(staFile.c_str(), std::ios::app); // append @@ -87,8 +79,12 @@ bool GrTableManager::WriteAssociationLog(GrCharStream * pchstrm, GrSegment * psegRet) { #ifdef TRACING + std::string staFile; + if (!LogFileName(staFile)) + return false; + std::ofstream strmOut; - strmOut.open("gr_xductn.log", std::ios::app); // append + strmOut.open(staFile.c_str(), std::ios::app); // append if (strmOut.fail()) return false; @@ -111,6 +107,26 @@ #ifdef TRACING /*---------------------------------------------------------------------------------------------- + Generate the name of the file where the log will be written. It goes in the directory + defined by either the TEMP or TMP environment variable. +----------------------------------------------------------------------------------------------*/ +bool GrTableManager::LogFileName(std::string & staFile) +{ + char * pchTmpEnv = getenv("TEMP"); + if (pchTmpEnv == 0) + pchTmpEnv = getenv("TMP"); + if (pchTmpEnv == 0) + return false; + + staFile.assign(pchTmpEnv); + if (staFile[staFile.size() - 1] != '\\') + staFile.append("\\"); + staFile.append("gr_xductn.log"); + + return true; +} + +/*---------------------------------------------------------------------------------------------- Output a file showing a log of the transduction process and the resulting segment. ----------------------------------------------------------------------------------------------*/ void GrTableManager::WriteXductnLog(std::ofstream & strmOut, @@ -362,9 +378,10 @@ } GrFeatureValues fval; - GrCharProps * pchrp; + //GrCharProps * pchrp; + int clrFore, clrBack; int ichwOffset, cchw16bit; - int nChar = NextGet(ptman, &fval, &pchrp, &ichwOffset, &cchw16bit); + int nChar = NextGet(ptman, &fval, &clrFore, &clrBack, &ichwOffset, &cchw16bit); cchw += cchw16bit; if (cchw <= cchwSkipBackup) {} // ignore - this is before the pre-segment stuff that we want to skip @@ -375,8 +392,8 @@ if (rgfNewRun[c]) { rgfval[c] = fval; - rgclrFore[c] = pchrp->clrFore; - rgclrBack[c] = pchrp->clrBack; + rgclrFore[c] = clrFore; + rgclrBack[c] = clrBack; } c++; } |
From: <sil...@li...> - 2004-10-26 21:09:31
|
Update of /cvsroot/silgraphite/silgraphite/src/GrCompiler/GdlPp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1625 Modified Files: cpp-1.5.tar.gz Log Message: check in proper binary file Index: cpp-1.5.tar.gz =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrCompiler/GdlPp/cpp-1.5.tar.gz,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 Binary files /tmp/cvsinAEnF and /tmp/cvsWqpjzh differ |
From: <sil...@li...> - 2004-10-26 21:07:38
|
Update of /cvsroot/silgraphite/silgraphite/src/GrCompiler/GdlPp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1091 Modified Files: CppDoc.pdf Log Message: check in proper binary file Index: CppDoc.pdf =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrCompiler/GdlPp/CppDoc.pdf,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 Binary files /tmp/cvsMH33Op and /tmp/cvsNV4ySB differ |
From: <sil...@li...> - 2004-10-25 22:41:39
|
Update of /cvsroot/silgraphite/silgraphite/contrib/pangomod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16670 Modified Files: Makefile.am Log Message: clean up a little and fix make dist Index: Makefile.am =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/pangomod/Makefile.am,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile.am 25 Oct 2004 21:23:54 -0000 1.4 +++ Makefile.am 25 Oct 2004 22:41:30 -0000 1.5 @@ -1,38 +1,34 @@ ## Process this file with automake to create Makefile.in. -#pangolibs = $(top_builddir)/pango/libpango-$(PANGO_API_VERSION).la $(GLIB_LIBS) -#pangoft2libs = $(top_builddir)/pango/libpangoft2-$(PANGO_API_VERSION).la $(FREETYPE_LIBS) $(pangolibs) - INCLUDES = \ -DPANGO_ENABLE_ENGINE \ -DPANGO_ENABLE_BACKEND \ -DG_DISABLE_DEPRECATED \ $(PANGO_DEBUG_FLAGS) \ - $(PANGO_CFLAGS) \ + $(PANGO_CFLAGS) \ $(GR_CFLAGS) -# -I$(top_srcdir) \ -# -I$(top_srcdir)/pango/ \ -# $(GLIB_CFLAGS) - -#INCLUDES += -I$(top_srcdir)/../../include -I$(top_srcdir)/../../src/GrEngine -#INCLUDES += -I$(top_srcdir)/../../src/TtfUtil -I$(top_srcdir)/../../src/lib -#INCLUDES += -I$(top_srcdir)/../../src/Generic - EXTRA_DIST = module.diff script.diff \ fontconfig.diff fontconfig-cvs.diff + +EXTRA_DIST += $(top_srcdir)/*.h -#moduledir = $(pkglibdir)/pango/$(PANGO_MODULE_VERSION)/modules moduledir = $(libdir)/silgraphite/pango/$(PANGO_MODULE_VERSION) -module_LTLIBRARIES = -noinst_LTLIBRARIES = +module_LTLIBRARIES = pango-silgraphite-fc.la -#noinst_PROGRAMS = stressengine testtext -bin_PROGRAMS = stressengine testtext +silgraphite_fc_sources = silgraphite-fc.c GrTextSrc.cpp \ + GrGraphics.cpp pangographite.cpp + +pango_silgraphite_fc_la_LDFLAGS = -export-dynamic -avoid-version -module +pango_silgraphite_fc_la_LIBADD = $(PANGO_LIBS) $(GR_LIBS) +pango_silgraphite_fc_la_SOURCES = $(silgraphite_fc_sources) + +noinst_PROGRAMS = stressengine testtext +#bin_PROGRAMS = stressengine testtext stressengine_LDADD = $(PANGO_LIBS) $(GRLIBS) pango-silgraphite-fc.la -stressengine_SOURCES = = stressengine.cpp +stressengine_SOURCES = stressengine.cpp testtext_LDADD = $(GTK_LIBS) testtext_SOURCES = \ @@ -40,31 +36,4 @@ testtext.c testtext_CFLAGS = $(GTK_CFLAGS) -#if HAVE_FREETYPE -#INCLUDES += $(FREETYPE_CFLAGS) -#if INCLUDE_SILGRAPHITE_FC -#noinst_LTLIBRARIES += libpango-silgraphite-fc.la -#else -module_LTLIBRARIES += pango-silgraphite-fc.la -#endif -#endif - -#if PLATFORM_WIN32 -#no_undefined = -no-undefined -#endif -no_undefined = -silgraphite_fc_sources = silgraphite-fc.c GrTextSrc.cpp \ - GrGraphics.cpp pangographite.cpp - -pango_silgraphite_fc_la_LDFLAGS = -export-dynamic -avoid-version -module $(no_undefined) -#pango_silgraphite_fc_la_LIBADD = $(pangoft2libs) -pango_silgraphite_fc_la_LIBADD = $(PANGO_LIBS) $(GR_LIBS) -pango_silgraphite_fc_la_SOURCES = $(silgraphite_fc_sources) -#libpango_silgraphite_fc_la_SOURCES = $(silgraphite_fc_sources) -#libpango_silgraphite_fc_la_CFLAGS = -DPANGO_MODULE_PREFIX=_pango_silgraphite_fc - - -included-modules: $(noinst_LTLIBRARIES) - -.PHONY: included-modules |
From: <sil...@li...> - 2004-10-25 22:40:39
|
Update of /cvsroot/silgraphite/silgraphite/contrib/pangomod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16363 Modified Files: configure.ac Log Message: clean up a little Index: configure.ac =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/pangomod/configure.ac,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- configure.ac 25 Oct 2004 21:23:54 -0000 1.4 +++ configure.ac 25 Oct 2004 22:40:30 -0000 1.5 @@ -1,9 +1,9 @@ +AC_PREREQ(2.54) # --------------------------------------------------------------------- # Initialisation # --------------------------------------------------------------------- -AC_INIT(pangographite, 1.1.2, sil...@li...) +AC_INIT(pangographite, 0.1, sil...@li...) AC_CONFIG_SRCDIR(pangographite.cpp) -AC_PREREQ(2.54) AC_REVISION($Revision$) AM_INIT_AUTOMAKE @@ -19,7 +19,6 @@ AC_ARG_ENABLE(profilefn, AC_HELP_STRING([--enable-profilefn], [allow functioncheck profiling (default=no)]), [enable_profilefn=yes],[enable_profilefn=no]) -AM_MAINTAINER_MODE # --------------------------------------------------------------------- # Check Programs @@ -33,8 +32,6 @@ # --------------------------------------------------------------------- # Checks for libraries. # --------------------------------------------------------------------- -#AM_ICONV -#AC_CHECK_LIB(grengine, grtxtDone) # --------------------------------------------------------------------- # Checks for header files. @@ -145,8 +142,6 @@ # --------------------------------------------------------------------- AC_SUBST(GR_CFLAGS) AC_SUBST(GR_LIBS) -AC_SUBST(PANGO_CFLAGS) -AC_SUBST(PANGO_LIBS) AC_SUBST(PANGO_DEBUG_CFLAGS) # --------------------------------------------------------------------- |
Update of /cvsroot/silgraphite/silgraphite/contrib/pangomod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31237 Modified Files: GrGraphics.cpp GrGraphics.h GrTextSrc.cpp GrTextSrc.h Makefile.am configure.ac pangographite.cpp Log Message: LgCharRenderProps -> GrCharProps Index: GrGraphics.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/pangomod/GrGraphics.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- GrGraphics.cpp 27 Aug 2004 10:19:00 -0000 1.2 +++ GrGraphics.cpp 25 Oct 2004 21:23:54 -0000 1.3 @@ -20,7 +20,7 @@ : m_pfont(hfont), m_xyFontEmSquare(0), m_Ascent(0), m_Descent(0) { m_hfont = pango_xft_font_get_font(hfont); - memset (&m_chrp, '\0', sizeof(LgCharRenderProps)); + memset (&m_chrp, '\0', sizeof(GrCharProps)); m_yinch = FUDGE_FACTOR; //m_face = m_hfont ? XftLockFace(m_hfont) : NULL; } @@ -120,9 +120,9 @@ #define GetGValue(rgb) ((BYTE) ((rgb) >> 8)) #define GetBValue(rgb) ((BYTE) ((rgb) >> 16)) -GrResult GrGraphics::SetupGraphics(LgCharRenderProps * pchrp) +GrResult GrGraphics::SetupGraphics(GrCharProps * pchrp) { - memcpy(&m_chrp, pchrp, sizeof(LgCharRenderProps)); + memcpy(&m_chrp, pchrp, sizeof(GrCharProps)); #if 0 // set the colour m_colour.color.red = GetRValue(pchrp->clrFore); @@ -308,8 +308,8 @@ return kresOk; } -GrResult GrGraphics::get_FontCharProperties(LgCharRenderProps*pchrp) +GrResult GrGraphics::get_FontCharProperties(GrCharProps*pchrp) { - memcpy(pchrp, &m_chrp, sizeof(LgCharRenderProps)); + memcpy(pchrp, &m_chrp, sizeof(GrCharProps)); return kresOk; } Index: GrGraphics.h =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/pangomod/GrGraphics.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- GrGraphics.h 27 Aug 2004 10:19:01 -0000 1.2 +++ GrGraphics.h 25 Oct 2004 21:23:54 -0000 1.3 @@ -41,9 +41,9 @@ virtual GrResult get_FontAscent(int* pdy); virtual GrResult get_FontDescent(int* pdy); virtual GrResult get_YUnitsPerInch(int * pyInch); - //will NOT change font face name regardless of LgCharRenderProps.szFaceName - virtual GrResult SetupGraphics(LgCharRenderProps * pchrp); - virtual GrResult get_FontCharProperties(LgCharRenderProps * pchrp); + //will NOT change font face name regardless of GrCharProps.szFaceName + virtual GrResult SetupGraphics(GrCharProps * pchrp); + virtual GrResult get_FontCharProperties(GrCharProps * pchrp); private: //XftDraw *m_draw; PangoFont *m_pfont; @@ -52,7 +52,7 @@ int m_xyFontEmSquare; int m_Ascent; int m_Descent; - LgCharRenderProps m_chrp; + GrCharProps m_chrp; //XftColor m_colour; MetricMap m_MetricCache; }; Index: GrTextSrc.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/pangomod/GrTextSrc.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- GrTextSrc.cpp 16 Sep 2004 14:44:31 -0000 1.5 +++ GrTextSrc.cpp 25 Oct 2004 21:23:54 -0000 1.6 @@ -5,7 +5,7 @@ #include <glib/gmessages.h> #include <glib/gmem.h> -GrTextSrc::GrTextSrc(const char* pszText, int length, LgCharRenderProps & chrp, +GrTextSrc::GrTextSrc(const char* pszText, int length, GrCharProps & chrp, const char * prgchFontVar, int ichFontVar) { #if 0 @@ -24,7 +24,7 @@ //memcpy(m_prgchText, pszText, isizeof(OLECHAR) * m_cchLength); m_prgchText[m_cchLength] = '\0'; // zero-terminate - memcpy(&m_chrp, &chrp, isizeof(LgCharRenderProps)); + memcpy(&m_chrp, &chrp, isizeof(GrCharProps)); memset(m_rgchFontVar, 0, isizeof(m_rgchFontVar)); //memcpy(m_rgchFontVar, prgchFontVar, std::min(ichFontVar, isizeof(m_rgchFontVar))); #ifdef __GNUC__ @@ -37,7 +37,7 @@ } #if 0 -GrTextSrc::GrTextSrc(const OLECHAR* pszText, LgCharRenderProps & chrp, +GrTextSrc::GrTextSrc(const OLECHAR* pszText, GrCharProps & chrp, const char * prgchFontVar, int ichFontVar) { m_cchLength = wcslen(pszText); @@ -47,7 +47,7 @@ memcpy(m_prgchText, pszText, isizeof(OLECHAR) * m_cchLength); m_prgchText[m_cchLength] = '\0'; // zero-terminate - memcpy(&m_chrp, &chrp, isizeof(LgCharRenderProps)); + memcpy(&m_chrp, &chrp, isizeof(GrCharProps)); memset(m_rgchFontVar, 0, isizeof(m_rgchFontVar)); //memcpy(m_rgchFontVar, prgchFontVar, std::min(ichFontVar, isizeof(m_rgchFontVar))); #ifdef __GNUC__ @@ -90,12 +90,12 @@ return kresOk; } -GrResult GrTextSrc::GetCharProps(int ich, LgCharRenderProps * pchrp, +GrResult GrTextSrc::GetCharProps(int ich, GrCharProps * pchrp, int * pichMin, int * pichLim) { *pichMin = 0; *pichLim = m_cchLength; - if (memcpy(pchrp, &m_chrp, isizeof(LgCharRenderProps))) + if (memcpy(pchrp, &m_chrp, isizeof(GrCharProps))) { return kresOk; } Index: GrTextSrc.h =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/pangomod/GrTextSrc.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- GrTextSrc.h 20 Aug 2004 23:42:26 -0000 1.3 +++ GrTextSrc.h 25 Oct 2004 21:23:54 -0000 1.4 @@ -6,17 +6,17 @@ class GrTextSrc : public IGrTextSource { public: - GrTextSrc(const char * pszText, int length, LgCharRenderProps & chrp, + GrTextSrc(const char * pszText, int length, GrCharProps & chrp, const char * prgchFontVar, int ichFontVar); #if 0 - GrTextSrc(const OLECHAR * pszText, LgCharRenderProps & chrp, + GrTextSrc(const OLECHAR * pszText, GrCharProps & chrp, const char * prgchFontVar, int ichFontVar); #endif ~GrTextSrc(); virtual GrResult Fetch(int ichMin, int ichLim, utf16 * prgchBuf); virtual GrResult get_Length(int * pcch); - virtual GrResult GetCharProps(int ich, LgCharRenderProps * pchrp, + virtual GrResult GetCharProps(int ich, GrCharProps * pchrp, int * pichMin, int * pichLim); virtual GrResult GetParaProps(int ich, LgParaRenderProps * pchrp, int * pichMin, int * pichLim); @@ -30,7 +30,7 @@ utf16 * m_prgchText; int m_cchLength; utf16 m_rgchFontVar[64]; - LgCharRenderProps m_chrp; + GrCharProps m_chrp; }; #endif Index: Makefile.am =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/pangomod/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile.am 27 Aug 2004 10:19:01 -0000 1.3 +++ Makefile.am 25 Oct 2004 21:23:54 -0000 1.4 @@ -20,6 +20,8 @@ #INCLUDES += -I$(top_srcdir)/../../src/TtfUtil -I$(top_srcdir)/../../src/lib #INCLUDES += -I$(top_srcdir)/../../src/Generic +EXTRA_DIST = module.diff script.diff \ + fontconfig.diff fontconfig-cvs.diff #moduledir = $(pkglibdir)/pango/$(PANGO_MODULE_VERSION)/modules moduledir = $(libdir)/silgraphite/pango/$(PANGO_MODULE_VERSION) Index: configure.ac =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/pangomod/configure.ac,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- configure.ac 27 Aug 2004 10:19:01 -0000 1.3 +++ configure.ac 25 Oct 2004 21:23:54 -0000 1.4 @@ -1,7 +1,7 @@ # --------------------------------------------------------------------- # Initialisation # --------------------------------------------------------------------- -AC_INIT(grpangomod, 1.1.2, sil...@li...) +AC_INIT(pangographite, 1.1.2, sil...@li...) AC_CONFIG_SRCDIR(pangographite.cpp) AC_PREREQ(2.54) AC_REVISION($Revision$) Index: pangographite.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/pangomod/pangographite.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- pangographite.cpp 16 Sep 2004 14:47:13 -0000 1.6 +++ pangographite.cpp 25 Oct 2004 21:23:54 -0000 1.7 @@ -63,8 +63,8 @@ int dichContext; GrSegment * pgrseg; - LgCharRenderProps * pchrp = new LgCharRenderProps(); - memset(pchrp, '\0', sizeof(LgCharRenderProps)); + GrCharProps * pchrp = new GrCharProps(); + memset(pchrp, '\0', sizeof(GrCharProps)); //pchrp->dympHeight = size * 1000; // font size in millipoints GrTextSrc * pgrtext; pgrtext = new GrTextSrc(text, length, *pchrp, "", 0); |
From: <sil...@li...> - 2004-10-25 19:32:02
|
Update of /cvsroot/silgraphite/silgraphite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7879 Modified Files: Makefile.am Log Message: dist the rpm spec files Index: Makefile.am =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/Makefile.am,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- Makefile.am 23 Oct 2004 22:19:09 -0000 1.15 +++ Makefile.am 25 Oct 2004 19:31:54 -0000 1.16 @@ -1,7 +1,7 @@ AUTOMAKE_OPTIONS = 1.6 SUBDIRS = lib src -EXTRA_DIST = contrib doc License \ +EXTRA_DIST = contrib doc License rpm \ autogen.sh gdlpp.mak GrCompiler.mak Makefile.PL makefile.vc \ README README.cvs README.macosx README.SILGraphite-Powered HISTORY \ silgraphite.pc.in |
Update of /cvsroot/silgraphite/silgraphite/src/GrCompiler/GdlPp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3406 Modified Files: cpp1.c cpp2.c cpp3.c cpp4.c cpp5.c cpp6.c memory.c usecpp.c Log Message: gcc prefers some extra brackets - remove warnings Index: cpp1.c =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrCompiler/GdlPp/cpp1.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- cpp1.c 21 Apr 2003 21:24:18 -0000 1.1 +++ cpp1.c 25 Oct 2004 19:08:41 -0000 1.2 @@ -15,6 +15,9 @@ * * ---------------------------------------------------------------------------- * $Log$ + * Revision 1.2 2004/10/25 19:08:41 danglassey + * gcc prefers some extra brackets - remove warnings + * * Revision 1.1 2003/04/21 21:24:18 wardak * Add files for the GDL pre-processor (gdlpp.exe). * @@ -471,7 +474,7 @@ Putstring(global, global->spacebuf); /* Output all whitespaces */ } } - if(ret=macroid(global, &c)) /* Grab the token */ + if((ret=macroid(global, &c))) /* Grab the token */ return(ret); } while (type[c] == LET && catenate(global, &ret) && !ret); if(ret) Index: cpp2.c =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrCompiler/GdlPp/cpp2.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- cpp2.c 21 Apr 2003 21:24:18 -0000 1.1 +++ cpp2.c 25 Oct 2004 19:08:41 -0000 1.2 @@ -15,6 +15,9 @@ * * ---------------------------------------------------------------------------- * $Log$ + * Revision 1.2 2004/10/25 19:08:41 danglassey + * gcc prefers some extra brackets - remove warnings + * * Revision 1.1 2003/04/21 21:24:18 wardak * Add files for the GDL pre-processor (gdlpp.exe). * @@ -244,7 +247,7 @@ while( c != '\n' && c != EOF_CHAR ) { - if( ret = save( global, c ) ) + if( (ret = save( global, c )) ) return(ret); c = get( global ); @@ -252,7 +255,7 @@ unget( global ); - if( ret = save( global, EOS ) ) + if( (ret = save( global, EOS )) ) return(ret); /* @@ -598,7 +601,7 @@ delim = skipws( global ); - if( ret = macroid( global, &delim ) ) + if( (ret = macroid( global, &delim )) ) return(ret); if( delim != '<' && delim != '"' ) @@ -614,7 +617,7 @@ global->workp = global->work; while( (c = get(global)) != '\n' && c != EOF_CHAR ) - if( ret = save( global, c ) ) /* Put it away. */ + if( (ret = save( global, c )) ) /* Put it away. */ return( ret ); unget( global ); /* Force nl after include */ Index: cpp3.c =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrCompiler/GdlPp/cpp3.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- cpp3.c 21 Apr 2003 21:24:18 -0000 1.1 +++ cpp3.c 25 Oct 2004 19:08:41 -0000 1.2 @@ -15,6 +15,9 @@ * * ---------------------------------------------------------------------------- * $Log$ + * Revision 1.2 2004/10/25 19:08:41 danglassey + * gcc prefers some extra brackets - remove warnings + * * Revision 1.1 2003/04/21 21:24:18 wardak * Add files for the GDL pre-processor (gdlpp.exe). * @@ -237,7 +240,7 @@ char *text=(char *)tags->data; sizp = size_table; - if (isdatum = (*text != '*')) /* If it's just -S, */ + if ( (isdatum = (*text != '*')) ) /* If it's just -S, */ endtest = T_FPTR; /* Stop here */ else { /* But if it's -S* */ text++; /* Step over '*' */ Index: cpp4.c =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrCompiler/GdlPp/cpp4.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- cpp4.c 21 Apr 2003 21:24:18 -0000 1.1 +++ cpp4.c 25 Oct 2004 19:08:41 -0000 1.2 @@ -15,6 +15,9 @@ * * ---------------------------------------------------------------------------- * $Log$ + * Revision 1.2 2004/10/25 19:08:41 danglassey + * gcc prefers some extra brackets - remove warnings + * * Revision 1.1 2003/04/21 21:24:18 wardak * Add files for the GDL pre-processor (gdlpp.exe). * @@ -175,7 +178,7 @@ } while (global->workp > global->work && type[global->workp[-1]] == SPA) --global->workp; /* Erase leading spaces */ - if(ret=save(global, TOK_SEP)) /* Stuff a delimiter */ + if((ret=save(global, TOK_SEP))) /* Stuff a delimiter */ return(ret); c = skipws(global); /* Eat whitespace */ continue; Index: cpp5.c =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrCompiler/GdlPp/cpp5.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- cpp5.c 17 Jul 2003 10:16:34 -0000 1.2 +++ cpp5.c 25 Oct 2004 19:08:41 -0000 1.3 @@ -15,6 +15,9 @@ * * ---------------------------------------------------------------------------- * $Log$ + * Revision 1.3 2004/10/25 19:08:41 danglassey + * gcc prefers some extra brackets - remove warnings + * * Revision 1.2 2003/07/17 10:16:34 mhosken * Main linux port checkin * @@ -426,7 +429,7 @@ loop=FALSE; do { /* Collect the token */ c = skipws(global); - if(ret=macroid(global, &c)) + if((ret=macroid(global, &c))) return(ret); if (c == EOF_CHAR || c == '\n') { unget(global); @@ -567,7 +570,7 @@ */ typecode = 0; while ((c = skipws(global))) { - if(ret=macroid(global, &c)) + if((ret=macroid(global, &c))) return(ret); /* (I) return on fail! */ if (c == EOF_CHAR || c == '\n') { Index: cpp6.c =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrCompiler/GdlPp/cpp6.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- cpp6.c 21 Apr 2003 21:24:18 -0000 1.1 +++ cpp6.c 25 Oct 2004 19:08:41 -0000 1.2 @@ -15,6 +15,9 @@ * * ---------------------------------------------------------------------------- * $Log$ + * Revision 1.2 2004/10/25 19:08:41 danglassey + * gcc prefers some extra brackets - remove warnings + * * Revision 1.1 2003/04/21 21:24:18 wardak * Add files for the GDL pre-processor (gdlpp.exe). * @@ -241,7 +244,7 @@ if (global->infile != NULL && global->infile->fp != NULL) global->recursion = 0; while (type[*c] == LET && (dp = lookid(global, *c)) != NULL) { - if(ret=expand(global, dp)) + if((ret=expand(global, dp))) return(ret); *c = get(global); } Index: memory.c =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrCompiler/GdlPp/memory.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- memory.c 21 Apr 2003 21:24:18 -0000 1.1 +++ memory.c 25 Oct 2004 19:08:41 -0000 1.2 @@ -15,6 +15,9 @@ * * ---------------------------------------------------------------------------- * $Log$ + * Revision 1.2 2004/10/25 19:08:41 danglassey + * gcc prefers some extra brackets - remove warnings + * * Revision 1.1 2003/04/21 21:24:18 wardak * Add files for the GDL pre-processor (gdlpp.exe). * @@ -195,5 +198,5 @@ #elif UNIX free((char *)MallocKey); #endif - } while(MallocKey=prev); + } while((MallocKey=prev)); } Index: usecpp.c =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrCompiler/GdlPp/usecpp.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- usecpp.c 21 Apr 2003 21:24:18 -0000 1.1 +++ usecpp.c 25 Oct 2004 19:08:41 -0000 1.2 @@ -15,6 +15,9 @@ * * ---------------------------------------------------------------------------- * $Log$ + * Revision 1.2 2004/10/25 19:08:41 danglassey + * gcc prefers some extra brackets - remove warnings + * * Revision 1.1 2003/04/21 21:24:18 wardak * Add files for the GDL pre-processor (gdlpp.exe). * @@ -278,7 +281,7 @@ Length_U = ftell(PrefsFile_PF); fseek(PrefsFile_PF, 0, SEEK_SET); - if (*string = (char *)malloc(Length_U+1)) { + if ((*string = (char *)malloc(Length_U+1))) { fread(*string, 1, Length_U, PrefsFile_PF); (*string)[Length_U] = '\0'; @@ -292,9 +295,9 @@ } #ifdef GDLPP - if(environ = getenv("GDLPP_PREFS")) { + if((environ = getenv("GDLPP_PREFS"))) { #else - if(environ = getenv("CPP_PREFS")) { + if((environ = getenv("CPP_PREFS"))) { #endif ret= !DoString(tagptr, environ); if(ret && *string) |
From: <sil...@li...> - 2004-10-25 18:14:02
|
Update of /cvsroot/silgraphite/silgraphite/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22321 Modified Files: Makefile.am Log Message: include major.minor release num in lib name Index: Makefile.am =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/lib/Makefile.am,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Makefile.am 12 Apr 2004 10:24:26 -0000 1.6 +++ Makefile.am 25 Oct 2004 18:13:54 -0000 1.7 @@ -7,7 +7,7 @@ lib_LTLIBRARIES = libgrengine.la -libgrengine_la_LDFLAGS = -version-info 2:2:1 +libgrengine_la_LDFLAGS = -release 1.1 -version-info 2:2:1 EXTRA_DIST= pkginclude_HEADERS = |
From: <sil...@li...> - 2004-10-25 18:11:06
|
Update of /cvsroot/silgraphite/silgraphite/contrib/pangomod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21475 Modified Files: README Log Message: update README with some install instructions Index: README =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/pangomod/README,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- README 22 Oct 2004 10:24:25 -0000 1.2 +++ README 25 Oct 2004 18:10:57 -0000 1.3 @@ -1,4 +1,5 @@ -work in progress +Patches +------- pango.diff is a patch for pango to allow it to use a module/engine declared as covering PANGO_SCRIPT_PREFERRED before any other matching engine. @@ -10,6 +11,11 @@ Some debug code needs removed before I submit it. +module.diff has debug removed, apply instead of pango.diff +_not_ as well as. + +script.diff is the second part of the pango patch. + fontconfig.diff is a patch for fontconfig to allow it to detect fonts with the Silf table and cache that information. It has been submitted as fontconfig bug 105 @@ -17,3 +23,30 @@ it works for fontconfig 2.2.3 fontconfig-cvs.diff is the same change but for fontconfig CVS HEAD. + +Building +-------- + +assuming you are installing everything to the same prefix dir <prefix> + +export PATH=<prefix>/bin:$PATH +export LD_LIBRARY_PATH=<prefix>/lib:$LD_LIBRARY_PATH +export PKG_CONFIG_DIR=<prefix>/lib/pkgconfig:$PKG_CONFIG_DIR + +Build and install fontconfig to <prefix> +Build and install pango to <prefix> +Build and install silgraphite to <prefix> +Build and install pangographite to <prefix> + +Finally ou need to create a file ~/.pangorc which has +[Pango] +ModulesPath=<path to installed pangographite module>:<path to installed pango modules> + +e.g. +[Pango] +ModulesPath=/opt/graphite/lib/silgraphite/pango/1.5.2:/opt/graphite/lib/pango/1.4.0/modules + +Then run pango-querymodules > <prefix>/etc/pango/pango.modules +e.g. pango-querymodules > /opt/graphite/etc/pango/pango.modules + +Now when you run a program - try testtext, it should start using graphite if it can. |
From: <sil...@li...> - 2004-10-23 22:22:28
|
Update of /cvsroot/silgraphite/silgraphite/src/GrCompiler In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1666 Removed Files: autogen.sh configure.ac Log Message: grcompiler uses files in rest of graphite source so it should be built as such --- autogen.sh DELETED --- --- configure.ac DELETED --- |
From: <sil...@li...> - 2004-10-23 22:19:20
|
Update of /cvsroot/silgraphite/silgraphite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv804 Modified Files: Makefile.am autogen.sh Log Message: fix make distcheck Index: Makefile.am =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/Makefile.am,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- Makefile.am 12 Apr 2004 10:24:07 -0000 1.14 +++ Makefile.am 23 Oct 2004 22:19:09 -0000 1.15 @@ -1,9 +1,9 @@ AUTOMAKE_OPTIONS = 1.6 SUBDIRS = lib src -EXTRA_DIST = contrib debian doc License \ +EXTRA_DIST = contrib doc License \ autogen.sh gdlpp.mak GrCompiler.mak Makefile.PL makefile.vc \ - README README.cvs README.macosx README.SILGraphite-Powered readme.txt HISTORY \ + README README.cvs README.macosx README.SILGraphite-Powered HISTORY \ silgraphite.pc.in pkgconfigdir = $(libdir)/pkgconfig @@ -13,7 +13,7 @@ dist-hook: find $(distdir) -name CVS | xargs rm -rf + cd $(distdir)/contrib && rm -rf fonts freetype pangomod wxHelloWorld XftHelloWorld cd $(top_srcdir)/contrib/Perl && perl Makefile.PL cd $(top_srcdir)/contrib/Perl && make realclean - cd $(top_srcdir)/contrib/XftHelloWorld && ./autogen.sh Index: autogen.sh =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/autogen.sh,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- autogen.sh 12 Apr 2004 10:24:07 -0000 1.8 +++ autogen.sh 23 Oct 2004 22:19:09 -0000 1.9 @@ -21,8 +21,14 @@ AUTOMAKE="$AUTODIR""automake" $AUTOMAKE --foreign -a -c; -if test -e src/GrCompiler/autogen.sh; then - cd src/GrCompiler; +#if test -e src/GrCompiler/autogen.sh; then +# cd src/GrCompiler; +# source ./autogen.sh +# cd ../.. +#fi + +if test -e contrib/pangomod/autogen.sh; then + cd contrib/pangomod; source ./autogen.sh cd ../.. fi |
From: <sil...@li...> - 2004-10-23 22:16:29
|
Update of /cvsroot/silgraphite/silgraphite/src/Generic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32455/src/Generic Modified Files: Makefile.am Log Message: need some EXTRA_DIST for make distcheck to work Index: Makefile.am =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/Generic/Makefile.am,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile.am 12 Apr 2004 10:24:27 -0000 1.5 +++ Makefile.am 23 Oct 2004 22:16:17 -0000 1.6 @@ -3,4 +3,7 @@ libgrengine_la_SOURCES += $(genericdir)/Debug.cpp libgrengine_la_SOURCES += $(genericdir)/Util.cpp libgrengine_la_SOURCES += $(genericdir)/UtilString.cpp + +EXTRA_DIST += $(genericdir)/*.h +EXTRA_DIST += $(genericdir)/Vector_i.cpp #resourcestrings.cpp |
From: <sil...@li...> - 2004-10-23 22:11:26
|
Update of /cvsroot/silgraphite/silgraphite/src/GrCompiler/Grammar In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30872/Grammar Modified Files: Makefile.am Log Message: need some EXTRA_DIST for make distcheck to work Index: Makefile.am =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrCompiler/Grammar/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile.am 13 Apr 2004 08:00:23 -0000 1.3 +++ Makefile.am 23 Oct 2004 22:11:14 -0000 1.4 @@ -1,4 +1,4 @@ -grammar_dir = Grammar +grammar_dir = $(top_srcdir)/src/GrCompiler/Grammar grcompiler_SOURCES += $(grammar_dir)/AST.cpp grcompiler_SOURCES += $(grammar_dir)/ANTLRException.cpp @@ -20,3 +20,7 @@ grcompiler_SOURCES += $(grammar_dir)/String.cpp grcompiler_SOURCES += $(grammar_dir)/Token.cpp grcompiler_SOURCES += $(grammar_dir)/TokenBuffer.cpp + +EXTRA_DIST += $(grammar_dir)/Antlr/*.hpp +EXTRA_DIST += $(grammar_dir)/*.hpp + |
From: <sil...@li...> - 2004-10-23 22:11:25
|
Update of /cvsroot/silgraphite/silgraphite/src/GrCompiler In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30872 Modified Files: Makefile.am Log Message: need some EXTRA_DIST for make distcheck to work Index: Makefile.am =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrCompiler/Makefile.am,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Makefile.am 22 Jul 2004 12:10:12 -0000 1.7 +++ Makefile.am 23 Oct 2004 22:11:14 -0000 1.8 @@ -9,6 +9,8 @@ LDADD = ../../lib/libgrengine.la +EXTRA_DIST = $(top_srcdir)/src/GrCompiler/*.h +EXTRA_DIST += $(top_srcdir)/src/GrCompiler/*.hpp bin_PROGRAMS = grcompiler @@ -41,6 +43,8 @@ grcompiler_SOURCES += Platform.cpp grcompiler_SOURCES += PostParser.cpp +EXTRA_DIST += HashMap_i.cpp +EXTRA_DIST += Set_i.cpp include Grammar/Makefile.am |
From: <sil...@li...> - 2004-10-23 22:08:03
|
Update of /cvsroot/silgraphite/silgraphite/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30023 Modified Files: GrDebug.h Log Message: reverting GrDebug to 1.2 Index: GrDebug.h =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/include/GrDebug.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- GrDebug.h 23 Oct 2004 22:01:45 -0000 1.3 +++ GrDebug.h 23 Oct 2004 22:07:53 -0000 1.4 @@ -117,9 +117,7 @@ #define DoAssertHr(hr) Assert(SUCCEEDED(hr)) #define DoAssertHrC(hr) AssertC(SUCCEEDED(hr)) #else -#include <assert.h> - #define Assert(exp) assert(exp) - #define AssertA(exp) + #define Assert(exp) #define AssertC(exp) #define AssertMsg(exp, msg) #define AssertMsgC(exp, msg) @@ -138,23 +136,23 @@ #define DoAssertHrC(hr) (hr) #endif //DEBUG -#define AssertPtr(pv) AssertA(ValidReadPtr(pv)) -#define AssertPtrN(pv) AssertA(!(pv) || ValidReadPtr(pv)) -#define AssertArray(pv, cv) AssertA((cv) >= 0 && ValidReadPtrSize((pv), isizeof(*(pv)) * (cv))) -#define AssertArrayN(pv, cv) AssertA((cv) >= 0 && (!(pv) || ValidReadPtrSize((pv), isizeof(*(pv)) * (cv)))) -#define AssertPtrSize(pv, cb) AssertA((cb) >= 0 && ValidReadPtrSize((pv), cb)) +#define AssertPtr(pv) Assert(ValidReadPtr(pv)) +#define AssertPtrN(pv) Assert(!(pv) || ValidReadPtr(pv)) +#define AssertArray(pv, cv) Assert((cv) >= 0 && ValidReadPtrSize((pv), isizeof(*(pv)) * (cv))) +#define AssertArrayN(pv, cv) Assert((cv) >= 0 && (!(pv) || ValidReadPtrSize((pv), isizeof(*(pv)) * (cv)))) +#define AssertPtrSize(pv, cb) Assert((cb) >= 0 && ValidReadPtrSize((pv), cb)) -#define AssertPfn(pfn) AssertA(!IsBadCodePtr((FARPROC)(pfn))) -#define AssertPfnN(pfn) AssertA(!(pfn) || !IsBadCodePtr((FARPROC)(pfn))) +#define AssertPfn(pfn) Assert(!IsBadCodePtr((FARPROC)(pfn))) +#define AssertPfnN(pfn) Assert(!(pfn) || !IsBadCodePtr((FARPROC)(pfn))) -#define AssertPsz(psz) AssertA(ValidPsz(psz)) -#define AssertPszN(psz) AssertA(!(psz) || ValidPsz(psz)) +#define AssertPsz(psz) Assert(ValidPsz(psz)) +#define AssertPszN(psz) Assert(!(psz) || ValidPsz(psz)) -#define AssertBstr(bstr) AssertA(ValidBstr(bstr)) -#define AssertBstrN(bstr) AssertA(!(bstr) || ValidBstr(bstr)) +#define AssertBstr(bstr) Assert(ValidBstr(bstr)) +#define AssertBstrN(bstr) Assert(!(bstr) || ValidBstr(bstr)) -#define AssertObj(pv) AssertA(ValidReadPtr(pv) && (pv)->AssertValid()) -#define AssertObjN(pv) AssertA(!(pv) || ValidReadPtr(pv) && (pv)->AssertValid()) +#define AssertObj(pv) Assert(ValidReadPtr(pv) && (pv)->AssertValid()) +#define AssertObjN(pv) Assert(!(pv) || ValidReadPtr(pv) && (pv)->AssertValid()) /*---------------------------------------------------------------------------------------------- This class implements custom output to the debugger. The results of Watch() can be |
From: <sil...@li...> - 2004-10-23 22:02:00
|
Update of /cvsroot/silgraphite/silgraphite/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28421 Modified Files: GrDebug.h Makefile.am Log Message: a few more headers to dist Index: GrDebug.h =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/include/GrDebug.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- GrDebug.h 12 Apr 2004 10:24:25 -0000 1.2 +++ GrDebug.h 23 Oct 2004 22:01:45 -0000 1.3 @@ -117,7 +117,9 @@ #define DoAssertHr(hr) Assert(SUCCEEDED(hr)) #define DoAssertHrC(hr) AssertC(SUCCEEDED(hr)) #else - #define Assert(exp) +#include <assert.h> + #define Assert(exp) assert(exp) + #define AssertA(exp) #define AssertC(exp) #define AssertMsg(exp, msg) #define AssertMsgC(exp, msg) @@ -136,23 +138,23 @@ #define DoAssertHrC(hr) (hr) #endif //DEBUG -#define AssertPtr(pv) Assert(ValidReadPtr(pv)) -#define AssertPtrN(pv) Assert(!(pv) || ValidReadPtr(pv)) -#define AssertArray(pv, cv) Assert((cv) >= 0 && ValidReadPtrSize((pv), isizeof(*(pv)) * (cv))) -#define AssertArrayN(pv, cv) Assert((cv) >= 0 && (!(pv) || ValidReadPtrSize((pv), isizeof(*(pv)) * (cv)))) -#define AssertPtrSize(pv, cb) Assert((cb) >= 0 && ValidReadPtrSize((pv), cb)) +#define AssertPtr(pv) AssertA(ValidReadPtr(pv)) +#define AssertPtrN(pv) AssertA(!(pv) || ValidReadPtr(pv)) +#define AssertArray(pv, cv) AssertA((cv) >= 0 && ValidReadPtrSize((pv), isizeof(*(pv)) * (cv))) +#define AssertArrayN(pv, cv) AssertA((cv) >= 0 && (!(pv) || ValidReadPtrSize((pv), isizeof(*(pv)) * (cv)))) +#define AssertPtrSize(pv, cb) AssertA((cb) >= 0 && ValidReadPtrSize((pv), cb)) -#define AssertPfn(pfn) Assert(!IsBadCodePtr((FARPROC)(pfn))) -#define AssertPfnN(pfn) Assert(!(pfn) || !IsBadCodePtr((FARPROC)(pfn))) +#define AssertPfn(pfn) AssertA(!IsBadCodePtr((FARPROC)(pfn))) +#define AssertPfnN(pfn) AssertA(!(pfn) || !IsBadCodePtr((FARPROC)(pfn))) -#define AssertPsz(psz) Assert(ValidPsz(psz)) -#define AssertPszN(psz) Assert(!(psz) || ValidPsz(psz)) +#define AssertPsz(psz) AssertA(ValidPsz(psz)) +#define AssertPszN(psz) AssertA(!(psz) || ValidPsz(psz)) -#define AssertBstr(bstr) Assert(ValidBstr(bstr)) -#define AssertBstrN(bstr) Assert(!(bstr) || ValidBstr(bstr)) +#define AssertBstr(bstr) AssertA(ValidBstr(bstr)) +#define AssertBstrN(bstr) AssertA(!(bstr) || ValidBstr(bstr)) -#define AssertObj(pv) Assert(ValidReadPtr(pv) && (pv)->AssertValid()) -#define AssertObjN(pv) Assert(!(pv) || ValidReadPtr(pv) && (pv)->AssertValid()) +#define AssertObj(pv) AssertA(ValidReadPtr(pv) && (pv)->AssertValid()) +#define AssertObjN(pv) AssertA(!(pv) || ValidReadPtr(pv) && (pv)->AssertValid()) /*---------------------------------------------------------------------------------------------- This class implements custom output to the debugger. The results of Watch() can be Index: Makefile.am =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/include/Makefile.am,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- Makefile.am 7 Oct 2004 07:57:11 -0000 1.9 +++ Makefile.am 23 Oct 2004 22:01:45 -0000 1.10 @@ -5,6 +5,7 @@ pkginclude_HEADERS += $(top_srcdir)/include/GrData.h pkginclude_HEADERS += $(top_srcdir)/include/GrDebug.h pkginclude_HEADERS += $(top_srcdir)/include/GrEngine.h +pkginclude_HEADERS += $(top_srcdir)/include/GrExt.h pkginclude_HEADERS += $(top_srcdir)/include/GrFeature.h pkginclude_HEADERS += $(top_srcdir)/include/GrMstypes.h pkginclude_HEADERS += $(top_srcdir)/include/GrPlatform.h @@ -12,8 +13,10 @@ pkginclude_HEADERS += $(top_srcdir)/include/GrSegment.h pkginclude_HEADERS += $(top_srcdir)/include/GrSegmentPlatform.h pkginclude_HEADERS += $(top_srcdir)/include/GrStructs.h +pkginclude_HEADERS += $(top_srcdir)/include/GrWrappers.h #pkginclude_HEADERS += $(top_srcdir)/include/IGrGraphicsDrawing.h #pkginclude_HEADERS += $(top_srcdir)/include/IGrGraphicsFont.h +pkginclude_HEADERS += $(top_srcdir)/include/IGrEngine.h pkginclude_HEADERS += $(top_srcdir)/include/IGrGraphics.h pkginclude_HEADERS += $(top_srcdir)/include/IGrTextSource.h pkginclude_HEADERS += $(top_srcdir)/include/IGrJustifier.h |
From: <sil...@li...> - 2004-10-22 10:24:37
|
Update of /cvsroot/silgraphite/silgraphite/contrib/pangomod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2155 Modified Files: README fontconfig.diff Added Files: fontconfig-cvs.diff Log Message: The fontconfig release and CVS patches need to be different --- NEW FILE: fontconfig-cvs.diff --- Index: fontconfig/fontconfig.h =================================================================== RCS file: /cvs/fontconfig/fontconfig/fontconfig/fontconfig.h,v retrieving revision 1.56 diff -u -w -u -w -r1.56 fontconfig.h --- fontconfig/fontconfig.h 30 Jun 2004 20:06:41 -0000 1.56 +++ fontconfig/fontconfig.h 21 Oct 2004 16:22:04 -0000 @@ -89,6 +89,7 @@ #define FC_CHARSET "charset" /* CharSet */ #define FC_LANG "lang" /* String RFC 3066 langs */ #define FC_FONTVERSION "fontversion" /* Int from 'head' table */ +#define FC_CAPABILITY "capability" /* String */ #define FC_DIR_CACHE_FILE "fonts.cache-"FC_CACHE_VERSION #define FC_USER_CACHE_FILE ".fonts.cache-"FC_CACHE_VERSION Index: src/fcfreetype.c =================================================================== RCS file: /cvs/fontconfig/fontconfig/src/fcfreetype.c,v retrieving revision 1.50 diff -u -w -u -w -r1.50 fcfreetype.c --- src/fcfreetype.c 29 May 2004 19:32:41 -0000 1.50 +++ src/fcfreetype.c 21 Oct 2004 16:22:05 -0000 @@ -55,6 +55,9 @@ #include FT_SFNT_NAMES_H #include FT_TRUETYPE_IDS_H #include FT_TYPE1_TABLES_H +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_SFNT_H +#include FT_INTERNAL_TRUETYPE_TYPES_H #if HAVE_FT_GET_BDF_PROPERTY #include FT_BDF_H @@ -385,6 +388,7 @@ FT_Library ftLibrary; FcChar8 *family = 0; FcChar8 *style = 0; + FcChar8 *complex = 0; const FcChar8 *foundry = 0; int spacing; TT_OS2 *os2; @@ -400,6 +404,7 @@ FT_UInt snamei, snamec; FcBool family_allocated = FcFalse; FcBool style_allocated = FcFalse; + FcBool complex_allocated = FcFalse; int family_prio = 0; int style_prio = 0; @@ -820,6 +825,12 @@ case 9: width = FC_WIDTH_ULTRAEXPANDED; break; } } + if (os2 && FcFontCapabilities(face, &complex)) + { + complex_allocated = FcTrue; + if (!FcPatternAddString (pat, FC_CAPABILITY, complex)) + goto bail1; + } /* * Type 1: Check for FontInfo dictionary information @@ -1066,6 +1077,9 @@ free (family); if (style_allocated) free (style); + if (complex_allocated) + free (complex); + FT_Done_Face (face); FT_Done_FreeType (ftLibrary); @@ -2067,3 +2081,178 @@ return FcFreeTypeCharSetAndSpacing (face, blanks, &spacing); } + + +#define TTAG_GPOS FT_MAKE_TAG( 'G', 'P', 'O', 'S' ) +#define TTAG_GSUB FT_MAKE_TAG( 'G', 'S', 'U', 'B' ) +#define TTAG_SILF FT_MAKE_TAG( 'S', 'i', 'l', 'f') +#define TT_Err_Ok FT_Err_Ok +#define TT_Err_Invalid_Face_Handle FT_Err_Invalid_Face_Handle +#define TTO_Err_Empty_Script 0x1005 +#define TTO_Err_Invalid_SubTable 0x1001 + + +void addtag(FcChar8 *complex, FT_ULong tag) +{ + FcChar8 tagstring[15]; + sprintf (tagstring, "otlayout:%c%c%c%c ", + (unsigned char)(tag >> 24), + (unsigned char)((tag & 0xff0000) >> 16), + (unsigned char)((tag & 0xff00) >> 8), + (unsigned char)(tag & 0xff)); + strncat(complex, tagstring, 14); +} + +static int compareulong (const void *a, const void *b) +{ + const FT_ULong *ua = (const FT_ULong *) a; + const FT_ULong *ub = (const FT_ULong *) b; + return *ua - *ub; +} + + +FT_Error GetScriptTags(FT_Face face, FT_ULong tabletag, FT_ULong **stags, FT_UShort *script_count) +{ + FT_ULong cur_offset, new_offset, base_offset; + FT_UShort i, num_lookups; + TT_Face tt_face = (TT_Face)face; + FT_Stream stream = face->stream; + FT_Error error; + FT_UShort n, p; + FT_Memory memory = stream->memory; + + if ( !stream ) + return TT_Err_Invalid_Face_Handle; + + if (( error = tt_face->goto_table( tt_face, tabletag, stream, 0 ) )) + return error; + + base_offset = FT_STREAM_POS(); + + /* skip version */ + + if ( FT_STREAM_SEEK( base_offset + 4L ) || + FT_FRAME_ENTER( 2L ) ) + return error; + + new_offset = FT_GET_USHORT() + base_offset; + + FT_FRAME_EXIT(); + + cur_offset = FT_STREAM_POS(); + + if ( FT_STREAM_SEEK( new_offset ) != TT_Err_Ok ) + return error; + + base_offset = FT_STREAM_POS(); + + if ( FT_FRAME_ENTER( 2L ) ) + return error; + + *script_count = FT_GET_USHORT(); + + FT_FRAME_EXIT(); + + if ( FT_SET_ERROR (FT_MEM_ALLOC_ARRAY( *stags, *script_count, FT_ULong )) ) + return error; + + p = 0; + for ( n = 0; n < *script_count; n++ ) + { + if ( FT_FRAME_ENTER( 6L ) ) + goto Fail; + + (*stags)[p] = FT_GET_ULONG(); + new_offset = FT_GET_USHORT() + base_offset; + + FT_FRAME_EXIT(); + + cur_offset = FT_STREAM_POS(); + + if ( FT_STREAM_SEEK( new_offset ) ) + goto Fail; + + if ( error == TT_Err_Ok ) + p++; + else if ( error != TTO_Err_Empty_Script ) + goto Fail; + + (void)FT_STREAM_SEEK( cur_offset ); + } + + if (!p) + { + error = TTO_Err_Invalid_SubTable; + goto Fail; + } + + // sort the tag list before returning it + qsort(*stags, *script_count, sizeof(FT_ULong), compareulong); + + return TT_Err_Ok; + + Fail: + FT_FREE( *stags ); + return error; +} + + +FcBool FcFontCapabilities(FT_Face face, FcChar8 **complex) +{ + FcBool issilgraphitefont = 0; + FT_Error err; + FT_ULong len = 0; + FT_ULong *gsubtags=NULL, *gpostags=NULL; + FT_UShort gsub_count=0, gpos_count=0, maxsize; + FT_Memory memory = face->stream->memory; + + if (*complex) + { + free(*complex); + *complex = 0; + } + err = FT_Load_Sfnt_Table(face, TTAG_SILF, 0, 0, &len); + issilgraphitefont = ( err == FT_Err_Ok); + + err = GetScriptTags(face, TTAG_GPOS, &gpostags, &gpos_count); + err = GetScriptTags(face, TTAG_GSUB, &gsubtags, &gsub_count); + if (!issilgraphitefont && !gsub_count && !gpos_count) + { + goto bail; + } + + maxsize = ((gpos_count + gsub_count) * 15) + (issilgraphitefont ? 13 : 0); + *complex = (FcChar8 *) malloc (sizeof (FcChar8) * maxsize); + if (issilgraphitefont) + { + strcpy(*complex, "ttable:Silf "); + } + else + { + strcpy(*complex, ""); + } + + int indx1 = 0, indx2 = 0; + while ((indx1 < gsub_count) || (indx2 < gpos_count)) { + if (indx1 == gsub_count) { + addtag(*complex, gpostags[indx2]); + indx2++; + } else if ((indx2 == gpos_count) || (gsubtags[indx1] < gpostags[indx2])) { + addtag(*complex, gsubtags[indx1]); + indx1++; + } else if (gsubtags[indx1] == gpostags[indx2]) { + addtag(*complex, gsubtags[indx1]); + indx1++; + indx2++; + } else { + addtag(*complex, gpostags[indx2]); + indx2++; + } + } + if (FcDebug () & FC_DBG_PARSE) + printf("complex features in this font: %s\n", *complex); +bail: + FT_FREE(gsubtags); + FT_FREE(gpostags); + return (*complex)!=NULL; +} Index: src/fcmatch.c =================================================================== RCS file: /cvs/fontconfig/fontconfig/src/fcmatch.c,v retrieving revision 1.25 diff -u -w -u -w -r1.25 fcmatch.c --- src/fcmatch.c 29 May 2004 19:32:41 -0000 1.25 +++ src/fcmatch.c 21 Oct 2004 16:22:06 -0000 @@ -220,6 +220,9 @@ { FC_FONTVERSION, FcCompareNumber, 14, 14 }, #define MATCH_FONTVERSION 13 + + { FC_CAPABILITY, FcCompareString, 15, 15 }, +#define MATCH_CAPABILITY 14 }; #define NUM_MATCH_VALUES 15 @@ -258,7 +261,13 @@ } break; case 'c': + switch (FcToLower (object[1])) { + case 'a': + i = MATCH_CAPABILITY; break; + case 'h': i = MATCH_CHARSET; break; + } + break; case 'a': i = MATCH_ANTIALIAS; break; case 'l': Index: src/fcname.c =================================================================== RCS file: /cvs/fontconfig/fontconfig/src/fcname.c,v retrieving revision 1.21 diff -u -w -u -w -r1.21 fcname.c --- src/fcname.c 23 Sep 2003 20:12:20 -0000 1.21 +++ src/fcname.c 21 Oct 2004 16:22:06 -0000 @@ -63,6 +63,7 @@ { FC_CHARSET, FcTypeCharSet }, { FC_LANG, FcTypeLangSet }, { FC_FONTVERSION, FcTypeInteger }, + { FC_CAPABILITY, FcTypeString } }; #define NUM_OBJECT_TYPES (sizeof _FcBaseObjectTypes / sizeof _FcBaseObjectTypes[0]) Index: README =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/pangomod/README,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- README 12 Apr 2004 10:24:24 -0000 1.1 +++ README 22 Oct 2004 10:24:25 -0000 1.2 @@ -14,3 +14,6 @@ with the Silf table and cache that information. It has been submitted as fontconfig bug 105 http://freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=105 +it works for fontconfig 2.2.3 + +fontconfig-cvs.diff is the same change but for fontconfig CVS HEAD. Index: fontconfig.diff =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/pangomod/fontconfig.diff,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- fontconfig.diff 12 Apr 2004 10:24:24 -0000 1.1 +++ fontconfig.diff 22 Oct 2004 10:24:25 -0000 1.2 @@ -1,11 +1,11 @@ Index: fontconfig/fontconfig.h =================================================================== RCS file: /cvs/fontconfig/fontconfig/fontconfig/fontconfig.h,v -retrieving revision 1.50 -diff -u -w -r1.50 fontconfig.h ---- fontconfig/fontconfig.h 27 Oct 2003 10:47:53 -0000 1.50 -+++ fontconfig/fontconfig.h 28 Feb 2004 16:17:45 -0000 -@@ -89,6 +89,7 @@ +retrieving revision 1.42.2.3 +diff -u -w -u -w -r1.42.2.3 fontconfig.h +--- fontconfig/fontconfig.h 30 Jun 2004 18:53:39 -0000 1.42.2.3 ++++ fontconfig/fontconfig.h 22 Oct 2004 10:19:14 -0000 +@@ -88,6 +88,7 @@ #define FC_CHARSET "charset" /* CharSet */ #define FC_LANG "lang" /* String RFC 3066 langs */ #define FC_FONTVERSION "fontversion" /* Int from 'head' table */ @@ -16,10 +16,10 @@ Index: src/fcfreetype.c =================================================================== RCS file: /cvs/fontconfig/fontconfig/src/fcfreetype.c,v -retrieving revision 1.45 -diff -u -w -r1.45 fcfreetype.c ---- src/fcfreetype.c 11 Feb 2004 18:53:05 -0000 1.45 -+++ src/fcfreetype.c 28 Feb 2004 16:17:49 -0000 +retrieving revision 1.26.2.4 +diff -u -w -u -w -r1.26.2.4 fcfreetype.c +--- src/fcfreetype.c 30 Mar 2004 17:17:20 -0000 1.26.2.4 ++++ src/fcfreetype.c 22 Oct 2004 10:19:15 -0000 @@ -55,6 +55,9 @@ #include FT_SFNT_NAMES_H #include FT_TRUETYPE_IDS_H @@ -28,9 +28,9 @@ +#include FT_INTERNAL_SFNT_H +#include FT_INTERNAL_TRUETYPE_TYPES_H - #if HAVE_FT_GET_BDF_PROPERTY + #if (FREETYPE_MINOR > 1 || (FREETYPE_MINOR == 1 && FREETYPE_PATCH >= 4)) #include FT_BDF_H -@@ -382,6 +385,7 @@ +@@ -294,6 +297,7 @@ FT_Library ftLibrary; FcChar8 *family = 0; FcChar8 *style = 0; @@ -38,7 +38,7 @@ const FcChar8 *foundry = 0; int spacing; TT_OS2 *os2; -@@ -397,6 +401,7 @@ +@@ -304,6 +308,7 @@ FT_UInt snamei, snamec; FcBool family_allocated = FcFalse; FcBool style_allocated = FcFalse; @@ -46,30 +46,27 @@ int family_prio = 0; int style_prio = 0; -@@ -817,6 +822,12 @@ +@@ -750,6 +755,19 @@ case 9: width = FC_WIDTH_ULTRAEXPANDED; break; } } -+ if (os2 && FcFontCapabilities(face, &complex)) -+ { -+ complex_allocated = FcTrue; -+ if (!FcPatternAddString (pat, FC_CAPABILITY, complex)) -+ goto bail1; ++ if (os2 && FcFontCapabilities(face, &complex)) ++ { ++ complex_allocated = FcTrue; ++ if (!FcPatternAddString (pat, FC_CAPABILITY, complex)) ++ { ++ if (complex_allocated) ++ free (complex); ++ goto bail1; ++ } + } ++ ++ if (complex_allocated) ++ free (complex); /* * Type 1: Check for FontInfo dictionary information -@@ -1061,6 +1072,9 @@ - free (family); - if (style_allocated) - free (style); -+ if (complex_allocated) -+ free (complex); -+ - - FT_Done_Face (face); - FT_Done_FreeType (ftLibrary); -@@ -2059,3 +2073,178 @@ +@@ -1747,3 +1765,178 @@ return FcFreeTypeCharSetAndSpacing (face, blanks, &spacing); } @@ -248,18 +245,49 @@ + FT_FREE(gpostags); + return (*complex)!=NULL; +} +Index: src/fcmatch.c +=================================================================== +RCS file: /cvs/fontconfig/fontconfig/src/fcmatch.c,v +retrieving revision 1.24 +diff -u -w -u -w -r1.24 fcmatch.c +--- src/fcmatch.c 12 Mar 2003 22:16:25 -0000 1.24 ++++ src/fcmatch.c 22 Oct 2004 10:19:16 -0000 +@@ -220,6 +220,9 @@ + + { FC_FONTVERSION, FcCompareNumber, 14, 14 }, + #define MATCH_FONTVERSION 13 ++ ++ { FC_CAPABILITY, FcCompareString, 15, 15 }, ++#define MATCH_CAPABILITY 14 + }; + + #define NUM_MATCH_VALUES 15 +@@ -258,7 +261,13 @@ + } + break; + case 'c': ++ switch (FcToLower (object[1])) { ++ case 'a': ++ i = MATCH_CAPABILITY; break; ++ case 'h': + i = MATCH_CHARSET; break; ++ } ++ break; + case 'a': + i = MATCH_ANTIALIAS; break; + case 'l': Index: src/fcname.c =================================================================== RCS file: /cvs/fontconfig/fontconfig/src/fcname.c,v -retrieving revision 1.21 -diff -u -w -r1.21 fcname.c ---- src/fcname.c 23 Sep 2003 20:12:20 -0000 1.21 -+++ src/fcname.c 28 Feb 2004 16:17:50 -0000 -@@ -63,6 +63,7 @@ +retrieving revision 1.18 +diff -u -w -u -w -r1.18 fcname.c +--- src/fcname.c 12 Mar 2003 22:16:25 -0000 1.18 ++++ src/fcname.c 22 Oct 2004 10:19:16 -0000 +@@ -62,6 +62,7 @@ { FC_CHARSET, FcTypeCharSet }, { FC_LANG, FcTypeLangSet }, { FC_FONTVERSION, FcTypeInteger }, -+ { FC_CAPABILITY, FcTypeString }, ++ { FC_CAPABILITY, FcTypeString } }; #define NUM_OBJECT_TYPES (sizeof _FcBaseObjectTypes / sizeof _FcBaseObjectTypes[0]) |