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...> - 2005-05-27 18:18:37
|
Update of /cvsroot/silgraphite/silgraphite/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19623/include Modified Files: Tag: v2api GrStructs.h UtilString.h Log Message: Fixed bug in positioning mechanism (showed up in justified Burmese). Index: GrStructs.h =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/include/GrStructs.h,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -d -r1.1.2.1 -r1.1.2.2 --- GrStructs.h 27 Oct 2004 14:32:00 -0000 1.1.2.1 +++ GrStructs.h 27 May 2005 18:18:25 -0000 1.1.2.2 @@ -48,6 +48,7 @@ int value; } FeatureSetting; + } // namespace gr Index: UtilString.h =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/include/UtilString.h,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -u -d -r1.7 -r1.7.2.1 --- UtilString.h 12 Apr 2004 10:24:25 -0000 1.7 +++ UtilString.h 27 May 2005 18:18:26 -0000 1.7.2.1 @@ -331,7 +331,7 @@ { for ( ; --cch >= 0; prgch1++, prgch2++) { - if (*prgch1 != *prgch2 && gr::ToLower(*prgch1) != gr::ToLower(*prgch2)) + if (*prgch1 != *prgch2 && /*gr::*/ToLower(*prgch1) != /*gr::*/ToLower(*prgch2)) return false; } @@ -1431,10 +1431,10 @@ int ich; int cch = Length(); - ch = gr::ToLower(ch); + ch = /*gr::*/ToLower(ch); for (ich = ichMin; ich < cch; ich++) { - if (gr::ToLower(m_pbuf->m_rgch[ich]) == ch) + if (/*gr::*/ToLower(m_pbuf->m_rgch[ich]) == ch) return ich; } @@ -1476,12 +1476,12 @@ if (ichLast >= Length()) ichLast = Length() - 1; - ch = gr::ToLower(ch); + ch = /*gr::*/ToLower(ch); int ich; for (ich = ichLast; ich >= 0; --ich) { - if (gr::ToLower(m_pbuf->m_rgch[ich]) == ch) + if (/*gr::*/ToLower(m_pbuf->m_rgch[ich]) == ch) return ich; } @@ -1597,11 +1597,11 @@ // Last position in m_rgch where prgch can be. int ichLast = Length() - cch; int ich; - XChar ch = gr::ToLower(prgch[0]); + XChar ch = /*gr::*/ToLower(prgch[0]); for (ich = ichMin; ich <= ichLast; ich++) { - if (gr::ToLower(m_pbuf->m_rgch[ich]) == ch && + if (/*gr::*/ToLower(m_pbuf->m_rgch[ich]) == ch && EqualsRgchCI(m_pbuf->m_rgch + ich, prgch, cch)) { return ich; @@ -1714,11 +1714,11 @@ if (ichLast > Length() - cch) ichLast = Length() - cch; - XChar ch = gr::ToLower(prgch[0]); + XChar ch = /*gr::*/ToLower(prgch[0]); int ich; for (ich = ichLast; ich >= 0; --ich) { - if (gr::ToLower(m_pbuf->m_rgch[ich]) == ch && + if (/*gr::*/ToLower(m_pbuf->m_rgch[ich]) == ch && EqualsRgchCI(m_pbuf->m_rgch + ich, prgch, cch)) { return ich; @@ -1755,6 +1755,8 @@ //:> without initialization by a constructor. This is so other constructors can use //:> instances of StrBase without having to deal with the possibility of s_bufEmpty //:> being uninitialized. + StrBuffer() + {} long m_crefMinusOne; // The reference count minus one. size_t m_cb; // The byte count. XChar m_rgch[1]; // The characters. |
From: <sil...@li...> - 2005-05-27 18:18:37
|
Update of /cvsroot/silgraphite/silgraphite/src/Generic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19623/src/Generic Modified Files: Tag: v2api UtilString.cpp Log Message: Fixed bug in positioning mechanism (showed up in justified Burmese). Index: UtilString.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/Generic/UtilString.cpp,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -d -r1.6 -r1.6.2.1 --- UtilString.cpp 12 Apr 2004 10:24:28 -0000 1.6 +++ UtilString.cpp 27 May 2005 18:18:26 -0000 1.6.2.1 @@ -40,12 +40,13 @@ //:Associate with StrBase<utf16>. template class StrBase<utf16>; // Instantiation for XChar = utf16. -StrBase<utf16>::StrBuffer StrBase<utf16>::s_bufEmpty; // Instantiation of empty utf16 buffer. +//StrBase<utf16>::StrBuffer StrBase<utf16>::s_bufEmpty; // Instantiation of empty utf16 buffer. +template <> StrBase<utf16>::StrBuffer StrBase<utf16>::s_bufEmpty; // Instantiation of empty utf16 buffer. //:Associate with StrBase<schar>. template class StrBase<schar>; // Instantiation for XChar = schar. -StrBase<schar>::StrBuffer StrBase<schar>::s_bufEmpty; // Instantiation of empty schar buffer. - +//StrBase<schar>::StrBuffer StrBase<schar>::s_bufEmpty; // Instantiation of empty schar buffer. +template <> StrBase<schar>::StrBuffer StrBase<schar>::s_bufEmpty; // Instantiation of empty schar buffer. /*---------------------------------------------------------------------------------------------- Create a new internal buffer of size cch and return a pointer to the characters. |
Update of /cvsroot/silgraphite/silgraphite/src/GrEngine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19623/src/GrEngine Modified Files: Tag: v2api GrSlotState.cpp GrSlotState.h GrSlotStream.cpp GrSlotStream.h GrTableManager.cpp Log Message: Fixed bug in positioning mechanism (showed up in justified Burmese). Index: GrSlotState.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrSlotState.cpp,v retrieving revision 1.16.2.1 retrieving revision 1.16.2.2 diff -u -d -r1.16.2.1 -r1.16.2.2 --- GrSlotState.cpp 27 Oct 2004 14:32:02 -0000 1.16.2.1 +++ GrSlotState.cpp 27 May 2005 18:18:27 -0000 1.16.2.2 @@ -760,6 +760,7 @@ else { Assert(m_fShiftMod); + EnsureLocalAttachmentTree(ptman, psstrmIn, psstrmOut, islotThis); ZapMetricsAndPositionDownToBase(psstrmOut); ZapMetricsOfLeaves(psstrmOut); } @@ -776,6 +777,26 @@ } /*---------------------------------------------------------------------------------------------- + The shift attribute of a slot has been modified. Make sure any slots that are part of the + same attachment cluster are local to this stream. The reason for this is so that the + position calculations stay consistent within the stream. +----------------------------------------------------------------------------------------------*/ +void GrSlotState::EnsureLocalAttachmentTree(GrTableManager * ptman, + GrSlotStream * psstrmIn, GrSlotStream * psstrmOut, int islotThis) +{ + if (m_dislotRootFixed) + { + GrSlotState * pslotRoot = SlotAtOffset(psstrmOut, m_dislotRootFixed); + psstrmOut->EnsureLocalCopy(ptman, pslotRoot, psstrmIn); + } + for (size_t islot = 0; islot < m_vdislotAttLeaves.size(); islot++) + { + GrSlotState * pslotLeaf = SlotAtOffset(psstrmOut, m_vdislotAttLeaves[islot]); + psstrmOut->EnsureLocalCopy(ptman, pslotLeaf, psstrmIn); + } +} + +/*---------------------------------------------------------------------------------------------- The recipient slot is being attached to the argument slot. NOTE: the caller is responsible to zap the cached positions of following glyphs in the stream. Index: GrSlotState.h =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrSlotState.h,v retrieving revision 1.14.2.1 retrieving revision 1.14.2.2 diff -u -d -r1.14.2.1 -r1.14.2.2 --- GrSlotState.h 27 Oct 2004 14:32:02 -0000 1.14.2.1 +++ GrSlotState.h 27 May 2005 18:18:27 -0000 1.14.2.2 @@ -948,6 +948,9 @@ GrSlotState * SlotAtOffset(GrSlotStream * psstrm, int dislot); // ENHANCE SharonC: inline? + void EnsureLocalAttachmentTree(GrTableManager * ptman, + GrSlotStream * psstrmIn, GrSlotStream * psstrmOut, int islotThis); + void ZapCompositeMetrics() { m_nCompositeLevel = kNegInfinity; Index: GrSlotStream.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrSlotStream.cpp,v retrieving revision 1.18.2.1 retrieving revision 1.18.2.2 diff -u -d -r1.18.2.1 -r1.18.2.2 --- GrSlotStream.cpp 27 Oct 2004 14:32:02 -0000 1.18.2.1 +++ GrSlotStream.cpp 27 May 2005 18:18:27 -0000 1.18.2.2 @@ -1463,6 +1463,44 @@ } /*---------------------------------------------------------------------------------------------- + Make sure the stream contains a local instance of the given slot, not a copy used by + a previous pass. +----------------------------------------------------------------------------------------------*/ +void GrSlotStream::EnsureLocalCopy(GrTableManager * ptman, GrSlotState * pslot, + GrSlotStream * psstrmIn) +{ + //Assert(m_vpslot[islot + m_cslotPreSeg] == pslot); + Assert(pslot->PassModified() <= m_ipass); + + if (pslot->PassModified() < m_ipass) + { + int islot = pslot->PosPassIndex(); + Assert(SlotAtPosPassIndex(islot) == pslot); + GrSlotState * pslotNew; + ptman->State()->NewSlotCopy(pslot, m_ipass, &pslotNew); + m_vpslot[islot + m_cslotPreSeg] = pslotNew; + + psstrmIn->ReplaceSlotInReprocessBuffer(pslot, pslotNew); + } +} + +/*---------------------------------------------------------------------------------------------- + A slot has been replace within the coorsponding output stream. Make sure the reprocess + buffer of this stream constains the same slot. +----------------------------------------------------------------------------------------------*/ +void GrSlotStream::ReplaceSlotInReprocessBuffer(GrSlotState * pslotOld, GrSlotState * pslotNew) +{ + if (m_islotReprocPos > -1) + { + for (size_t islot = 0; islot < m_vpslotReproc.size(); islot++) + { + if (m_vpslotReproc[islot] == pslotOld) + m_vpslotReproc[islot] = pslotNew; + } + } +} + +/*---------------------------------------------------------------------------------------------- Inserting a line break can potentially alter the directionality of preceeding glyphs. Zap the information that has been calculated. Index: GrSlotStream.h =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrSlotStream.h,v retrieving revision 1.12 retrieving revision 1.12.2.1 diff -u -d -r1.12 -r1.12.2.1 --- GrSlotStream.h 6 Oct 2004 18:28:31 -0000 1.12 +++ GrSlotStream.h 27 May 2005 18:18:27 -0000 1.12.2.1 @@ -356,6 +356,9 @@ void AdjustPrevStreamNextChunkMap(GrTableManager * ptman, int islotMod, int nInc); void AdjustNextChunkMap(int islotMin, int islotMod, int nInc); + void EnsureLocalCopy(GrTableManager * ptman, GrSlotState * pslot, GrSlotStream * psstrmIn); + void ReplaceSlotInReprocessBuffer(GrSlotState * pslotOld, GrSlotState * pslotNew); + void ZapCalculatedDirLevels(int islotLB); int MaxClusterSlot(int islotChunkLim) Index: GrTableManager.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrTableManager.cpp,v retrieving revision 1.23.2.1 retrieving revision 1.23.2.2 diff -u -d -r1.23.2.1 -r1.23.2.2 --- GrTableManager.cpp 27 Oct 2004 14:32:02 -0000 1.23.2.1 +++ GrTableManager.cpp 27 May 2005 18:18:27 -0000 1.23.2.2 @@ -64,7 +64,8 @@ m_xsPosXNext(0), m_ysPosYNext(0), m_dxsTotWidthSoFar(0), - m_dxsVisWidthSoFar(0) + m_dxsVisWidthSoFar(0), + m_cpass(0) { m_vslotblk.clear(); m_vprgnSlotVarLenBufs.clear(); |
From: <sil...@li...> - 2005-05-27 10:21:24
|
Update of /cvsroot/silgraphite/silgraphite/src/GrCompiler/GdlPp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15353/src/GrCompiler/GdlPp Modified Files: cpp1.c cpp6.c memory.c Log Message: Get GrCompiler working on Linux Index: cpp1.c =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrCompiler/GdlPp/cpp1.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- cpp1.c 25 Oct 2004 19:08:41 -0000 1.2 +++ cpp1.c 27 May 2005 10:21:14 -0000 1.3 @@ -15,6 +15,9 @@ * * ---------------------------------------------------------------------------- * $Log$ + * Revision 1.3 2005/05/27 10:21:14 mhosken + * Get GrCompiler working on Linux + * * Revision 1.2 2004/10/25 19:08:41 danglassey * gcc prefers some extra brackets - remove warnings * @@ -680,7 +683,7 @@ */ if(!global->out) return; -#if defined(UNIX) +#if defined(unix) if(global->output) global->output(c, global->userdata); else Index: cpp6.c =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrCompiler/GdlPp/cpp6.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- cpp6.c 25 Oct 2004 19:08:41 -0000 1.2 +++ cpp6.c 27 May 2005 10:21:14 -0000 1.3 @@ -15,6 +15,9 @@ * * ---------------------------------------------------------------------------- * $Log$ + * Revision 1.3 2005/05/27 10:21:14 mhosken + * Get GrCompiler working on Linux + * * Revision 1.2 2004/10/25 19:08:41 danglassey * gcc prefers some extra brackets - remove warnings * @@ -1178,7 +1181,7 @@ MSG_PREFIX, tp, global->infile->fp?global->line:file->line, severity); if(global->error) global->error(global->userdata, ErrorMessage[error], arg); -#if defined(UNIX) +#if defined(unix) else vfprintf(stderr, ErrorMessage[error], arg); #elif defined(AMIGA) @@ -1226,7 +1229,7 @@ va_start(arg, format); if(global->error) global->error(global->userdata, format, arg); -#if defined(UNIX) +#if defined(unix) else vfprintf(stderr, format, arg); #endif Index: memory.c =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrCompiler/GdlPp/memory.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- memory.c 25 Oct 2004 19:08:41 -0000 1.2 +++ memory.c 27 May 2005 10:21:14 -0000 1.3 @@ -15,6 +15,9 @@ * * ---------------------------------------------------------------------------- * $Log$ + * Revision 1.3 2005/05/27 10:21:14 mhosken + * Get GrCompiler working on Linux + * * Revision 1.2 2004/10/25 19:08:41 danglassey * gcc prefers some extra brackets - remove warnings * @@ -34,7 +37,7 @@ #include <stdlib.h> #if defined(OS9) #include <types.h> -#elif defined(UNIX) +#elif defined(unix) #include <sys/types.h> #elif defined(AMIGA) #include <exec/types.h> @@ -83,7 +86,7 @@ void *Malloc(int size) { - char *alloc; + char *alloc = NULL; struct MemInfo *point; #ifdef DEBUG @@ -92,7 +95,7 @@ #ifdef AMIGA alloc=(char *)AllocMem(size+sizeof(struct MemInfo), 0L); -#elif defined(UNIX) +#elif defined(unix) alloc=(char *)malloc(size+sizeof(struct MemInfo)); #endif @@ -149,7 +152,7 @@ #ifdef AMIGA FreeMem(point, point->size+sizeof(struct MemInfo)); -#elif UNIX +#elif unix free(point); #endif } @@ -167,7 +170,7 @@ b++; if(b) { -#if defined(UNIX) +#if defined(unix) fprintf(stderr, "Memory violation: malloc(%d) was abused %d bytes!\n", point->size-MEMORY_COOKIE-sizeof(struct MemInfo), b); #elif defined(AMIGA) @@ -195,7 +198,7 @@ #endif #ifdef AMIGA FreeMem(MallocKey, point->size+sizeof(struct MemInfo)); -#elif UNIX +#elif unix free((char *)MallocKey); #endif } while((MallocKey=prev)); |
From: <sil...@li...> - 2005-05-27 10:21:23
|
Update of /cvsroot/silgraphite/silgraphite/src/GrCompiler In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15353/src/GrCompiler Modified Files: ErrorCheckClasses.cpp ParserTreeWalker.cpp Log Message: Get GrCompiler working on Linux Index: ErrorCheckClasses.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrCompiler/ErrorCheckClasses.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- ErrorCheckClasses.cpp 16 Apr 2004 22:26:49 -0000 1.9 +++ ErrorCheckClasses.cpp 27 May 2005 10:21:14 -0000 1.10 @@ -1203,32 +1203,46 @@ int nUnicodeStd; HRESULT hr; - if (fGotCharPropEng) - { - if (psym->LastFieldIs("breakweight")) - { - hr = qchprpeng->get_IsSeparator(nUnicode, &fIsSep); - nUnicodeStd = (fIsSep) ? klbWordBreak : nValue; - } - else if (psym->LastFieldIs("directionality")) - { - LgBidiCategory bidi; - hr = qchprpeng->get_BidiCategory(nUnicode, &bidi); - if (!FAILED(hr)) - nUnicodeStd = ConvertBidiCode(bidi, nUnicode); - else if (!Bidi()) - { - // Don't really care about the failure, since there's no Bidi pass. - hr = S_OK; - nUnicodeStd = kdircNeutral; - } - } - else - break; // ...out of the character loop; this is not an attribute + if (psym->LastFieldIs("breakweight")) + { + if (fGotCharPropEng) + { + hr = qchprpeng->get_IsSeparator(nUnicode, &fIsSep); + } + else + { + if (nUnicode == 0x0020 || nUnicode == 0x00A0 || nUnicode == 0x1680 || nUnicode == 0x180E + || (nUnicode >= 0x2000 && nUnicode <= 0x200A) || nUnicode == 0x202F + || nUnicode == 0x205F || nUnicode == 0x3000) + fIsSep = 1; + else + fIsSep = 0; + hr = S_OK; + } + nUnicodeStd = (fIsSep) ? klbWordBreak : nValue; + } + else if (psym->LastFieldIs("directionality")) + { +// g_errorList.AddWarning(NULL, "Bidi = ", Bidi() ? "1" : "0"); + if (!Bidi()) + { + // Don't really care about the failure, since there's no Bidi pass. + hr = S_OK; + nUnicodeStd = kdircNeutral; + } + else if (fGotCharPropEng) + { + LgBidiCategory bidi; + hr = qchprpeng->get_BidiCategory(nUnicode, &bidi); + if (!FAILED(hr)) + nUnicodeStd = ConvertBidiCode(bidi, nUnicode); + } + else + hr = E_FAIL; + } + else + break; // ...out of the character loop; this is not an attribute // it makes sense to read from the db - } - else - hr = E_FAIL; if (FAILED(hr)) { Index: ParserTreeWalker.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrCompiler/ParserTreeWalker.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- ParserTreeWalker.cpp 16 Apr 2004 22:26:50 -0000 1.10 +++ ParserTreeWalker.cpp 27 May 2005 10:21:14 -0000 1.11 @@ -189,9 +189,9 @@ case -1: cout << "can't fork\n"; exit(-1); case 0 : testexec = execlp("gdlpp","gdlpp","-V",staFileName.Chars(),tmpgdl,0); // this is the code the child runs - cout << "exec retval:" << testexec << ", errno:" << strerror(errno) << "(" << errno << ")\n"; - cout << "tmpfile " << tmpgdl << endl; - cout << "file " << staFileName.Chars() << endl; + cout << "// exec retval:" << testexec << ", errno:" << strerror(errno) << "(" << errno << ")\n"; + cout << "// tmpfile " << tmpgdl << endl; + cout << "// file " << staFileName.Chars() << endl; g_errorList.AddError(NULL, "Failed to run pre-processor gdlpp", "compiling ", |
From: <sil...@li...> - 2005-05-23 18:32:26
|
Update of /cvsroot/silgraphite/silgraphite/src/GrEngine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17499/src/GrEngine Modified Files: Tag: v2api GrSegment.cpp Log Message: Fixed a bug in the GetUniscribeClusters routine. Index: GrSegment.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrSegment.cpp,v retrieving revision 1.27.2.1 retrieving revision 1.27.2.2 diff -u -d -r1.27.2.1 -r1.27.2.2 --- GrSegment.cpp 27 Oct 2004 14:32:01 -0000 1.27.2.1 +++ GrSegment.cpp 23 May 2005 18:32:12 -0000 1.27.2.2 @@ -1952,6 +1952,11 @@ LgLineBreak lbFirst, lbLast; int isloutFirst = UnderlyingToLogicalSurface(ichBase, ich, true); + if (isloutFirst == kPosInfinity || isloutFirst == kNegInfinity) + { + *plb = klbClipBreak; + return kresFail; + } GrSlotOutput * psloutFirst = m_prgslout + isloutFirst; bool fNotFirst = false; if (psloutFirst->HasComponents() @@ -1967,6 +1972,11 @@ } int isloutLast = UnderlyingToLogicalSurface(ichBase, ich, false); + if (isloutLast == kPosInfinity || isloutLast == kNegInfinity) + { + *plb = klbClipBreak; + return kresFail; + } GrSlotOutput * psloutLast = m_prgslout + isloutLast; bool fNotLast = false; if (psloutLast->HasComponents() @@ -5342,12 +5352,16 @@ prgigbbFirstOfCluster returns the first glyph of the cluster for each CHARACTER (glyph indices returned are zero-based and refer to physical order--left-to-right, etc.). pfClusterStart returns a flag for each GLYPH indicating whether it is the first - of a cluster. + of a cluster. In this case the glyphs are ordered logically. Both arrays are optional. + + The fRtlLog flag is true for RTL text where the glyph arrays are returned in logical order + (the normal case for RTL). Then this method returns the END of the cluster rather than the + beginning; that is the first physical glyph in the cluster. ----------------------------------------------------------------------------------------------*/ GrResult GrSegment::GetUniscribeClusters(int ichwBase, IGrGraphics * pgg, int * prgigbbFirstOfCluster, int cchMax, int * pcch, - bool * pfClusterStart, int cfMax, int * pcf) + bool * pfClusterStart, int cfMax, int * pcf, bool fRtlLog) { ChkGrArgPtr(pgg); ChkGrOutPtr(pcch); @@ -5501,8 +5515,12 @@ // Convert (logical) slots to actual glyphs. for (ich = 0; ich < m_dichwLim; ich++) { + int isloutLeft = fRtlLog ? visloutAfter[ich] : visloutBefore[ich]; if (prgigbbFirstOfCluster) - prgigbbFirstOfCluster[ich] = LogicalToPhysicalSurface(visloutBefore[ich]); + prgigbbFirstOfCluster[ich] = LogicalToPhysicalSurface(isloutLeft); + + // pfClusterStart is dealing with logical ordering of glyphs, so here we use visloutBefore, + // not isloutLeft (maybe counter-intuitive). if (pfClusterStart) pfClusterStart[visloutBefore[ich] - isloutFirstReal] = true; @@ -5530,7 +5548,8 @@ int isloutMin = visloutBefore[ichStopOrig]; int ichStart = ichStopOrig; while (ichStart > 0 && - (ichStart > ichStartOrig || visloutBefore[ichStart - 1] >= visloutBefore[ichStopOrig])) + (ichStart > ichStartOrig || visloutBefore[ichStart - 1] >= visloutBefore[ichStopOrig] + || visloutBefore[ichStart - 1] == visloutBefore[ichStart])) { ichStart--; isloutMin = std::min(isloutMin, visloutBefore[ichStart]); @@ -5539,7 +5558,8 @@ int isloutMax = visloutAfter[ichStartOrig]; int ichStop = ichStartOrig; while (ichStop < m_dichwLim - 1 && - (ichStop < ichStopOrig || visloutAfter[ichStop + 1] <= visloutAfter[ichStartOrig])) + (ichStop < ichStopOrig || visloutAfter[ichStop + 1] <= visloutAfter[ichStartOrig] + || visloutAfter[ichStop + 1] == visloutAfter[ichStop])) { ichStop++; isloutMax = std::max(isloutMax, visloutAfter[ichStop]); @@ -5560,6 +5580,10 @@ natural location of the glyph and what is produced by Graphite. The y-offset is the same as GetGlyphsAndPositions. + Probably the right implementation is that base characters use only the advance width + and diacritics use the x-offset. But in Graphite it is not trivial to determine which + is which. + This is an experimental method. Its behavior may change signficantly in the future. ----------------------------------------------------------------------------------------------*/ GrResult GrSegment::GetUniscribePositions(int ichBase, IGrGraphics * pgg, |
From: <sil...@li...> - 2005-05-23 18:32:24
|
Update of /cvsroot/silgraphite/silgraphite/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17499/include Modified Files: Tag: v2api GrSegment.h Log Message: Fixed a bug in the GetUniscribeClusters routine. Index: GrSegment.h =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/include/GrSegment.h,v retrieving revision 1.22 retrieving revision 1.22.2.1 diff -u -d -r1.22 -r1.22.2.1 --- GrSegment.h 6 Oct 2004 18:28:30 -0000 1.22 +++ GrSegment.h 23 May 2005 18:32:12 -0000 1.22.2.1 @@ -162,7 +162,7 @@ GrResult GetUniscribeClusters(int ichBase, IGrGraphics * pgg, int * prgigbb1stOfCluster, int cchMax, int * pcch, - bool * pfClusterStart, int cfMax, int * pcf); + bool * pfClusterStart, int cfMax, int * pcf, bool fAfter = false); GrResult GetUniscribePositions(int ichBase, IGrGraphics * pgg, RECT rs, RECT rd, int cgidMax, int * pcgidRet, int * prgxd, int * prgyd, int * prgdxdAdv); |
From: <sil...@li...> - 2005-05-23 18:32:23
|
Update of /cvsroot/silgraphite/silgraphite/contrib/HelloWorld In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17499/contrib/HelloWorld Modified Files: Tag: v2api GrGraphics.cpp Log Message: Fixed a bug in the GetUniscribeClusters routine. Index: GrGraphics.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/HelloWorld/GrGraphics.cpp,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -d -r1.6 -r1.6.2.1 --- GrGraphics.cpp 6 Oct 2004 18:28:22 -0000 1.6 +++ GrGraphics.cpp 23 May 2005 18:32:11 -0000 1.6.2.1 @@ -133,8 +133,8 @@ memset(&lf, '\0', sizeof(LOGFONT)); lf.lfItalic = pchrp->ttvItalic == kttvOff ? false : true; lf.lfWeight = pchrp->ttvBold == kttvOff ? 400 : 700; - lf.lfHeight = -MulDiv(pchrp->dympHeight, m_yInch, 72000); // convert millipoints to pixels - lf.lfUnderline = false; + lf.lfHeight = -MulDiv(pchrp->dympHeight, m_yInch, 72000); // convert millipoints to pixels, + lf.lfUnderline = false; // and scale by resolution lf.lfWidth = 0; // default width, based on height lf.lfEscapement = 0; // no rotation of text (is this how to do slanted?) lf.lfOrientation = 0; // no rotation of character baselines |
From: <sil...@li...> - 2005-02-28 16:08:40
|
Update of /cvsroot/silgraphite/silgraphite/contrib/pangomod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19799 Modified Files: pangographite.cpp Log Message: don't use NULL in call to GetUniscribeClusters Index: pangographite.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/pangomod/pangographite.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- pangographite.cpp 24 Dec 2004 23:47:08 -0000 1.10 +++ pangographite.cpp 28 Feb 2005 16:08:30 -0000 1.11 @@ -126,6 +126,7 @@ int * prg1stCharInClust; int first_char_in_cluster, last_cluster_start = 0; int cluster_width = 0; + int cch, cf; //int * tmp; // find the length (in utf8 chars) of textsource @@ -144,8 +145,8 @@ pgrseg->GetUniscribeClusters(0, pgrfx, - prg1stOfCluster, n_chars, NULL, - pfClusterStart, n_glyphs, NULL); + prg1stOfCluster, n_chars, &cch, + pfClusterStart, n_glyphs, &cf); // BUG? single character strings prg1stOfCluster[0] = -1 // This isn't right though because it isn't guaranteed to be 0 @@ -243,11 +244,12 @@ glyphs->log_clusters[i] = g_utf8_offset_to_pointer(text, first_char_in_cluster) - text; #ifdef WDGDEBUG - g_message("glyph %d has lh%d lw%d lx%d ly%d xoff%d yoff%d wid%d", i, + g_message("glyph %d has lh%d lw%d lx%d ly%d xoff%d yoff%d wid%d logcl%d", i, logical_rect.height, logical_rect.width, logical_rect.x, logical_rect.y, glyphs->glyphs[i].geometry.x_offset, glyphs->glyphs[i].geometry.y_offset, - glyphs->glyphs[i].geometry.width); + glyphs->glyphs[i].geometry.width, + glyphs->log_clusters[i]); #endif |
From: <sil...@li...> - 2005-02-28 16:07:17
|
Update of /cvsroot/silgraphite/silgraphite/src/GrEngine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19342/GrEngine Modified Files: GrSegment.cpp Log Message: Patch from Sharon and Keith Stribley for Uniscribe bits Index: GrSegment.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrSegment.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- GrSegment.cpp 6 Oct 2004 18:28:31 -0000 1.27 +++ GrSegment.cpp 28 Feb 2005 16:06:55 -0000 1.28 @@ -1957,6 +1957,12 @@ LgLineBreak lbFirst, lbLast; int isloutFirst = UnderlyingToLogicalSurface(ichBase, ich, true); + if (isloutFirst == kPosInfinity || isloutFirst == kNegInfinity) + { + //printf("Invalid start surface position base%d ich%d\n", ichBase, ich); + *plb = klbClipBreak; + return kresFail; + } GrSlotOutput * psloutFirst = m_prgslout + isloutFirst; bool fNotFirst = false; if (psloutFirst->HasComponents() @@ -1972,6 +1978,12 @@ } int isloutLast = UnderlyingToLogicalSurface(ichBase, ich, false); + if (isloutLast == kPosInfinity || isloutLast == kNegInfinity) + { + //printf("Invalid end surface position base%d ich%d\n", ichBase, ich); + *plb = klbClipBreak; + return kresFail; + } GrSlotOutput * psloutLast = m_prgslout + isloutLast; bool fNotLast = false; if (psloutLast->HasComponents() @@ -5530,23 +5542,28 @@ { int ichStartOrig = min(ich1, ich2); int ichStopOrig = max(ich1, ich2); - - // Find the beginning of the cluster. + int isloutMin = visloutBefore[ichStopOrig]; + int isloutMax = visloutAfter[ichStopOrig]; + int ichStart = ichStopOrig; + int ichStop = ichStartOrig; + + // Find the beginning of the cluster. while (ichStart > 0 && (ichStart > ichStartOrig || visloutBefore[ichStart - 1] >= visloutBefore[ichStopOrig])) { ichStart--; isloutMin = std::min(isloutMin, visloutBefore[ichStart]); + isloutMax = std::max(isloutMax, visloutAfter[ichStart]); } + // Find end of cluster. - int isloutMax = visloutAfter[ichStartOrig]; - int ichStop = ichStartOrig; while (ichStop < m_dichwLim - 1 && (ichStop < ichStopOrig || visloutAfter[ichStop + 1] <= visloutAfter[ichStartOrig])) { ichStop++; + isloutMin = std::min(isloutMin, visloutBefore[ichStart]); isloutMax = std::max(isloutMax, visloutAfter[ichStop]); } |
From: <sil...@li...> - 2004-12-24 23:47:16
|
Update of /cvsroot/silgraphite/silgraphite/contrib/pangomod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15649 Modified Files: pangographite.cpp Log Message: oh, and the cursor is a lot better now but still enough problems to leave saying so til I do a bit more work, Happy Christmas :) Index: pangographite.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/pangomod/pangographite.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- pangographite.cpp 24 Dec 2004 23:35:05 -0000 1.9 +++ pangographite.cpp 24 Dec 2004 23:47:08 -0000 1.10 @@ -61,8 +61,8 @@ int ciNextSeg; OLECHAR errmsg[128]; int dichContext; - GrSegment * pgrseg; + GrCharProps * pchrp = new GrCharProps(); memset(pchrp, '\0', sizeof(GrCharProps)); //pchrp->dympHeight = size * 1000; // font size in millipoints @@ -87,7 +87,6 @@ &dichContext, // index of first char of interest to following seg errmsg, 128); // for returning an error message - if (res != kresOk) { g_warning("Could not create Graphite segment."); |
From: <sil...@li...> - 2004-12-24 23:36:51
|
Update of /cvsroot/silgraphite/silgraphite/contrib/pangomod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13748 Modified Files: Makefile.am Log Message: revert Makefile.am Index: Makefile.am =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/pangomod/Makefile.am,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Makefile.am 24 Dec 2004 23:35:05 -0000 1.7 +++ Makefile.am 24 Dec 2004 23:36:42 -0000 1.8 @@ -27,7 +27,7 @@ pango_silgraphite_fc_la_LIBADD = $(PANGO_LIBS) $(GR_LIBS) pango_silgraphite_fc_la_SOURCES = $(silgraphite_fc_sources) -noinst_PROGRAMS = stressengine testtext tmp +noinst_PROGRAMS = stressengine testtext #bin_PROGRAMS = stressengine testtext stressengine_LDADD = $(PANGO_LIBS) $(GRLIBS) pango-silgraphite-fc.la @@ -38,8 +38,5 @@ prop-editor.c \ testtext.c testtext_CFLAGS = $(GTK_CFLAGS) -tmp_SOURCES = tmp.c -tmp_CFLAGS = $(GTK_CFLAGS) -tmp_LDADD = $(GTK_LIBS) |
From: <sil...@li...> - 2004-12-24 23:35:18
|
Update of /cvsroot/silgraphite/silgraphite/contrib/pangomod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13388 Modified Files: GrGraphics.cpp Makefile.am configure.ac pangographite.cpp Log Message: use PANGO_PIXELS and pkgconfig check for fontconfig Index: GrGraphics.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/pangomod/GrGraphics.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- GrGraphics.cpp 8 Nov 2004 22:28:20 -0000 1.4 +++ GrGraphics.cpp 24 Dec 2004 23:35:05 -0000 1.5 @@ -220,24 +220,24 @@ #else PangoRectangle ink_rect, logical_rect; pango_font_get_glyph_extents(m_pfont, chw, &ink_rect, &logical_rect); - *pxAdvanceX = logical_rect.width/PANGO_SCALE; + *pxAdvanceX = PANGO_PIXELS(logical_rect.width); *pyAdvanceY = 0; - *pxBoundingWidth = ink_rect.width/PANGO_SCALE; - *pyBoundingHeight = ink_rect.height/PANGO_SCALE; - *pxBoundingX = ink_rect.x/PANGO_SCALE; - *pyBoundingY = -ink_rect.y/PANGO_SCALE; + *pxBoundingWidth = PANGO_PIXELS(ink_rect.width); + *pyBoundingHeight = PANGO_PIXELS(ink_rect.height); + *pxBoundingX = PANGO_PIXELS(ink_rect.x); + *pyBoundingY = -PANGO_PIXELS(ink_rect.y); #endif #if 0 - if (*pxAdvanceX != logical_rect.width/PANGO_SCALE) - g_warning("pxAdvanceX %d != %d", *pxAdvanceX, logical_rect.width/PANGO_SCALE); - if (*pxBoundingWidth != ink_rect.width/PANGO_SCALE) - g_warning("pxBoundingWidth %d != %d", *pxBoundingWidth, ink_rect.width/PANGO_SCALE); - if (*pyBoundingHeight != ink_rect.height/PANGO_SCALE) - g_warning("pyBoundingHeight %d != %d", *pyBoundingHeight, ink_rect.height/PANGO_SCALE); - if (*pxBoundingX != ink_rect.x/PANGO_SCALE) - g_warning("pxBoundingX %d != %d", *pxBoundingX, ink_rect.x/PANGO_SCALE); - if (*pyBoundingY != (ink_rect.y - *pyBoundingHeight)/PANGO_SCALE) - g_warning("pyBoundingY %d != %d", *pyBoundingY, (ink_rect.y - *pyBoundingHeight)/PANGO_SCALE); + if (*pxAdvanceX != PANGO_PIXELS(logical_rect.width); + g_warning("pxAdvanceX %d != %d", *pxAdvanceX, PANGO_PIXELS(logical_rect.width); + if (*pxBoundingWidth != PANGO_PIXELS(ink_rect.width); + g_warning("pxBoundingWidth %d != %d", *pxBoundingWidth, PANGO_PIXELS(ink_rect.width); + if (*pyBoundingHeight != PANGO_PIXELS(ink_rect.height); + g_warning("pyBoundingHeight %d != %d", *pyBoundingHeight, PANGO_PIXELS(ink_rect.height); + if (*pxBoundingX != PANGO_PIXELS(ink_rect.x); + g_warning("pxBoundingX %d != %d", *pxBoundingX, PANGO_PIXELS(ink_rect.x); + if (*pyBoundingY != PANGO_PIXELS((ink_rect.y - *pyBoundingHeight)); + g_warning("pyBoundingY %d != %d", *pyBoundingY, PANGO_PIXELS(ink_rect.y - *pyBoundingHeight)); #endif return kresOk; } Index: Makefile.am =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/pangomod/Makefile.am,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Makefile.am 27 Oct 2004 17:00:13 -0000 1.6 +++ Makefile.am 24 Dec 2004 23:35:05 -0000 1.7 @@ -27,7 +27,7 @@ pango_silgraphite_fc_la_LIBADD = $(PANGO_LIBS) $(GR_LIBS) pango_silgraphite_fc_la_SOURCES = $(silgraphite_fc_sources) -noinst_PROGRAMS = stressengine testtext +noinst_PROGRAMS = stressengine testtext tmp #bin_PROGRAMS = stressengine testtext stressengine_LDADD = $(PANGO_LIBS) $(GRLIBS) pango-silgraphite-fc.la @@ -38,5 +38,8 @@ prop-editor.c \ testtext.c testtext_CFLAGS = $(GTK_CFLAGS) +tmp_SOURCES = tmp.c +tmp_CFLAGS = $(GTK_CFLAGS) +tmp_LDADD = $(GTK_LIBS) Index: configure.ac =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/pangomod/configure.ac,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- configure.ac 25 Oct 2004 22:40:30 -0000 1.5 +++ configure.ac 24 Dec 2004 23:35:05 -0000 1.6 @@ -120,7 +120,7 @@ PANGO_MODULE_VERSION=`$PKG_CONFIG --modversion pango` AC_SUBST(PANGO_MODULE_VERSION) -PKG_CHECK_MODULES(PANGO, glib-2.0 pango pangoft2 pangoxft freetype2) +PKG_CHECK_MODULES(PANGO, glib-2.0 pango pangoft2 pangoxft freetype2 fontconfig) AC_SUBST(PANGO_CFLAGS) AC_SUBST(PANGO_LIBS) PKG_CHECK_MODULES(GTK, gtk+-2.0) Index: pangographite.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/pangomod/pangographite.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- pangographite.cpp 28 Oct 2004 15:50:29 -0000 1.8 +++ pangographite.cpp 24 Dec 2004 23:35:05 -0000 1.9 @@ -110,60 +110,113 @@ // Get the number of chars first pgrseg->GetGlyphsAndPositions(0, pgrfx, rs, rd, 0, &n_glyphs, NULL, NULL, NULL, NULL); - #if 0 - g_message("%d chars: %s", n_glyphs, text); - #endif prgchGlyphs = new utf16[n_glyphs]; prgxd = new int[n_glyphs]; prgyd = new int[n_glyphs]; prgdxdAdv = new int[n_glyphs]; + // now get the list of glyphs, xoffsets, yoffsets and advances pgrseg->GetUniscribeGlyphsAndPositions(0, pgrfx, rs, rd, n_glyphs, &n_glyphs, prgchGlyphs, prgxd, prgyd, prgdxdAdv); -#ifdef NEW_CLUSTER int n_chars; int * prg1stOfCluster; bool * pfClusterStart; int * prg1stCharInClust; - + int first_char_in_cluster, last_cluster_start = 0; + int cluster_width = 0; + //int * tmp; + + // find the length (in utf8 chars) of textsource pgrtext->get_Length(&n_chars); + //for each char in the utf8 string the first glyph that is in that cluster prg1stOfCluster = new int[n_chars]; + // for each glyph whether or not it is the first in a cluster pfClusterStart = new bool[n_glyphs]; + // for each glyph the first char that is in that cluster prg1stCharInClust = new int[n_glyphs]; - //int cch, cf; + //tmp = new int[n_glyphs]; + #ifdef WDGDEBUG + g_message("%d chars, %d glyphs: %s", n_chars, n_glyphs, text); + #endif + + pgrseg->GetUniscribeClusters(0, pgrfx, - prg1stOfCluster, n_chars, /*&cch*/NULL, - pfClusterStart, n_glyphs, /*&cf*/NULL); + prg1stOfCluster, n_chars, NULL, + pfClusterStart, n_glyphs, NULL); - #if 1 + // BUG? single character strings prg1stOfCluster[0] = -1 + // This isn't right though because it isn't guaranteed to be 0 + prg1stOfCluster[0] = 0; for (int i=n_glyphs-1; i>0; i--) { prg1stCharInClust[i] = -1; } + #ifdef WDGDEBUG + for (int i=0; i < n_chars; i++) + { + if ((prg1stOfCluster[i] < 0) || (prg1stOfCluster[i] >= n_glyphs)) + { + g_warning("char %d has a bad 1stof cluster %d", i, prg1stOfCluster[i]); + } + + } #endif prg1stCharInClust[0] = 0; for (int i=n_chars-1; i>=0; i--) { + #ifdef WDGDEBUG + g_message("prg1stCharInClust[%d] = %d", prg1stOfCluster[i], i); if (prg1stOfCluster[i]<0) { g_warning("prg1stOfCluster[%d]=%d < 0 => not good", i, prg1stOfCluster[i]); } else - prg1stCharInClust[prg1stOfCluster[i]] = i; - //g_message("prg1stCharInClust[%d] = %d", prg1stOfCluster[i], i); + #endif + prg1stCharInClust[prg1stOfCluster[i]] = i; } -#endif - + for (int i=1; i < n_glyphs; i++) + { + if (prg1stCharInClust[i] == -1) // 1cinc==-1 do need to deal with it + { + int j = i; + if (pfClusterStart[i]) // glyph is start of cluster + { + // travel forward to find a valid value + while (prg1stCharInClust[j] == -1) + { + j++; + } + } + else // glyph is not start of cluster + { + // travel back to find the a valid value + while (prg1stCharInClust[j] == -1) + { + j--; + } + } + if (j < 0 || j >= n_glyphs) + { + g_message("char %d out of range --%d", j, n_glyphs); + } + prg1stCharInClust[i] = prg1stCharInClust[j]; + } + #ifdef WDGDEBUG + g_message("1charin of glyph %d is %d(%d)", i, prg1stCharInClust[i], pfClusterStart[i]); + #endif + } + pango_glyph_string_set_size (glyphs, n_glyphs); PangoGlyph index; PangoRectangle logical_rect; int prev_offset = 0; - + int i, j; + for (int i=0; i<n_glyphs; i++) { //g_message("char %d", i); @@ -173,68 +226,44 @@ glyphs->glyphs[i].geometry.x_offset = PANGO_SCALE * prgxd[i]; -#if 0 - // pango x offset is graphite offset - previous offset - previous width - #if 1 - glyphs->glyphs[i].geometry.x_offset = PANGO_SCALE * prgxd[i]; - #else - if (i) - glyphs->glyphs[i].geometry.x_offset = PANGO_SCALE * (prgxd[i] - prev_offset - PANGO_PIXELS(logical_rect.width)); - else - glyphs->glyphs[i].geometry.x_offset = 0; - #endif - #if 0 - if (glyphs->glyphs[i].geometry.x_offset) - { - g_message("glyphs %d xoffset %d (%d %d %d) %d", i, glyphs->glyphs[i].geometry.x_offset, - prgxd[i], prev_offset, PANGO_PIXELS(logical_rect.width), prgdxdAdv[i]); - } - else - { - g_message("glyphs %d (%d %d %d) %d", i, - prgxd[i], prev_offset, PANGO_PIXELS(logical_rect.width), prgdxdAdv[i]); - } - #endif - prev_offset = prgxd[i]; -#endif - + pango_font_get_glyph_extents (xftfont, glyphs->glyphs[i].glyph, NULL, &logical_rect); - glyphs->glyphs[i].geometry.width = logical_rect.width; - - //glyphs->log_clusters[i] = prgdxdAdv[i]; - #ifdef NEW_CLUSTER + glyphs->glyphs[i].geometry.width = logical_rect.width; // !!WRONG - glyphs can overlap + // what I think I want to get is the forward width (advance?) for each glyph in a cluster + // then divide it by the number of glyphs in the cluster + if (pfClusterStart[i]) { if (prg1stCharInClust[i]==-1) g_warning("oops cluster wrong at %d", i); first_char_in_cluster = prg1stCharInClust[i]; } + + //tmp[i] = first_char_in_cluster; glyphs->log_clusters[i] = g_utf8_offset_to_pointer(text, first_char_in_cluster) - text; - #else - pgrseg->GlyphToChar(0, pgrfx, i, 1, &(glyphs->log_clusters[i])); - #endif - #if 0 - g_message("%d complete glyph %d xoff %d yoff %d width %d logclust %d", - i, glyphs->glyphs[i].glyph, - PANGO_PIXELS(glyphs->glyphs[i].geometry.x_offset), PANGO_PIXELS(glyphs->glyphs[i].geometry.y_offset), - PANGO_PIXELS(glyphs->glyphs[i].geometry.width), glyphs->log_clusters[i]); - #endif - //glyphs->glyphs[i].geometry.width = prgdxdAdv[i]; + #ifdef WDGDEBUG + g_message("glyph %d has lh%d lw%d lx%d ly%d xoff%d yoff%d wid%d", i, + logical_rect.height, logical_rect.width, + logical_rect.x, logical_rect.y, + glyphs->glyphs[i].geometry.x_offset, glyphs->glyphs[i].geometry.y_offset, + glyphs->glyphs[i].geometry.width); + #endif + } + glyphs->num_glyphs = n_glyphs; delete[] prgchGlyphs; delete[] prgxd; delete[] prgyd; delete[] prgdxdAdv; -#ifdef NEW_CLUSTER delete[] prg1stOfCluster; delete[] pfClusterStart; delete[] prg1stCharInClust; -#endif + //delete[] tmp; delete pgrseg; delete pgrtext; delete pchrp; |
From: <sil...@li...> - 2004-12-17 18:52:55
|
Update of /cvsroot/silgraphite/silgraphite/src/GrCompiler/GdlPp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11140 Modified Files: cpp-1.5.tar.gz Log Message: try again to store it as binary Index: cpp-1.5.tar.gz =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrCompiler/GdlPp/cpp-1.5.tar.gz,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 Binary files /tmp/cvs1T47W1 and /tmp/cvsivcc39 differ |
From: <sil...@li...> - 2004-11-08 22:28:34
|
Update of /cvsroot/silgraphite/silgraphite/contrib/pangomod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17060 Modified Files: GrGraphics.cpp Log Message: BoundingY was more than a bit wrong hopefully this is fixed now Index: GrGraphics.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/pangomod/GrGraphics.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- GrGraphics.cpp 25 Oct 2004 21:23:54 -0000 1.3 +++ GrGraphics.cpp 8 Nov 2004 22:28:20 -0000 1.4 @@ -225,7 +225,7 @@ *pxBoundingWidth = ink_rect.width/PANGO_SCALE; *pyBoundingHeight = ink_rect.height/PANGO_SCALE; *pxBoundingX = ink_rect.x/PANGO_SCALE; - *pyBoundingY = (ink_rect.y - *pyBoundingHeight)/PANGO_SCALE; + *pyBoundingY = -ink_rect.y/PANGO_SCALE; #endif #if 0 if (*pxAdvanceX != logical_rect.width/PANGO_SCALE) |
From: <sil...@li...> - 2004-10-29 17:53:27
|
Update of /cvsroot/silgraphite/silgraphite/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6550 Added Files: Tag: v2api FSM.pdf Log Message: Replacing FSM.pdf |
From: <sil...@li...> - 2004-10-29 17:44:38
|
Update of /cvsroot/silgraphite/silgraphite/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4810 Added Files: FSM.pdf GDL.pdf GTF_1_0.pdf GraphiteOverview.pdf SlotStream.pdf WrDataTransformEngine.pdf Log Message: Replaced PDFs |
Update of /cvsroot/silgraphite/silgraphite/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3697 Removed Files: FSM.pdf GDL.pdf GTF_1_0.pdf GraphiteOverview.pdf SlotStream.pdf WrDataTransformEngine.pdf Log Message: Removed PDF files to replace them properly --- FSM.pdf DELETED --- --- GDL.pdf DELETED --- --- GTF_1_0.pdf DELETED --- --- GraphiteOverview.pdf DELETED --- --- SlotStream.pdf DELETED --- --- WrDataTransformEngine.pdf DELETED --- |
From: <sil...@li...> - 2004-10-29 17:31:01
|
Update of /cvsroot/silgraphite/silgraphite/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1959 Removed Files: Tag: v2api FSM.pdf Log Message: Removing FSM.pdf in order to replace it --- FSM.pdf DELETED --- |
From: <sil...@li...> - 2004-10-28 15:50:38
|
Update of /cvsroot/silgraphite/silgraphite/contrib/pangomod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10098 Modified Files: pangographite.cpp Log Message: new cluster work ifdefd out Index: pangographite.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/pangomod/pangographite.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- pangographite.cpp 25 Oct 2004 21:23:54 -0000 1.7 +++ pangographite.cpp 28 Oct 2004 15:50:29 -0000 1.8 @@ -103,33 +103,68 @@ int * prgxd; int * prgyd; int * prgdxdAdv; - int n_chars; + int n_glyphs; Rect rs(0,0,100,100); Rect rd(0,0,100,100); // Get the number of chars first pgrseg->GetGlyphsAndPositions(0, pgrfx, - rs, rd, 0, &n_chars, NULL, NULL, NULL, NULL); + rs, rd, 0, &n_glyphs, NULL, NULL, NULL, NULL); #if 0 - g_message("%d chars: %s", n_chars, text); + g_message("%d chars: %s", n_glyphs, text); #endif - prgchGlyphs = new utf16[n_chars]; - prgxd = new int[n_chars]; - prgyd = new int[n_chars]; - prgdxdAdv = new int[n_chars]; + prgchGlyphs = new utf16[n_glyphs]; + prgxd = new int[n_glyphs]; + prgyd = new int[n_glyphs]; + prgdxdAdv = new int[n_glyphs]; pgrseg->GetUniscribeGlyphsAndPositions(0, pgrfx, - rs, rd, n_chars, &n_chars, prgchGlyphs, + rs, rd, n_glyphs, &n_glyphs, prgchGlyphs, prgxd, prgyd, prgdxdAdv); - pango_glyph_string_set_size (glyphs, n_chars); +#ifdef NEW_CLUSTER + int n_chars; + int * prg1stOfCluster; + bool * pfClusterStart; + int * prg1stCharInClust; + + pgrtext->get_Length(&n_chars); + prg1stOfCluster = new int[n_chars]; + pfClusterStart = new bool[n_glyphs]; + prg1stCharInClust = new int[n_glyphs]; + //int cch, cf; + + pgrseg->GetUniscribeClusters(0, pgrfx, + prg1stOfCluster, n_chars, /*&cch*/NULL, + pfClusterStart, n_glyphs, /*&cf*/NULL); + + #if 1 + for (int i=n_glyphs-1; i>0; i--) + { + prg1stCharInClust[i] = -1; + } + #endif + prg1stCharInClust[0] = 0; + for (int i=n_chars-1; i>=0; i--) + { + if (prg1stOfCluster[i]<0) + { + g_warning("prg1stOfCluster[%d]=%d < 0 => not good", i, prg1stOfCluster[i]); + } + else + prg1stCharInClust[prg1stOfCluster[i]] = i; + //g_message("prg1stCharInClust[%d] = %d", prg1stOfCluster[i], i); + } +#endif + + pango_glyph_string_set_size (glyphs, n_glyphs); PangoGlyph index; PangoRectangle logical_rect; int prev_offset = 0; - for (int i=0; i<n_chars; i++) + for (int i=0; i<n_glyphs; i++) { //g_message("char %d", i); //glyphs->glyphs[i].glyph = pango_fc_font_get_glyph ((PangoFcFont *) xftfont, prgchGlyphs[i]); @@ -167,7 +202,18 @@ glyphs->glyphs[i].geometry.width = logical_rect.width; //glyphs->log_clusters[i] = prgdxdAdv[i]; + #ifdef NEW_CLUSTER + if (pfClusterStart[i]) + { + if (prg1stCharInClust[i]==-1) + g_warning("oops cluster wrong at %d", i); + first_char_in_cluster = prg1stCharInClust[i]; + } + + glyphs->log_clusters[i] = g_utf8_offset_to_pointer(text, first_char_in_cluster) - text; + #else pgrseg->GlyphToChar(0, pgrfx, i, 1, &(glyphs->log_clusters[i])); + #endif #if 0 g_message("%d complete glyph %d xoff %d yoff %d width %d logclust %d", @@ -178,13 +224,17 @@ //glyphs->glyphs[i].geometry.width = prgdxdAdv[i]; } - glyphs->num_glyphs = n_chars; + glyphs->num_glyphs = n_glyphs; delete[] prgchGlyphs; delete[] prgxd; delete[] prgyd; delete[] prgdxdAdv; - +#ifdef NEW_CLUSTER + delete[] prg1stOfCluster; + delete[] pfClusterStart; + delete[] prg1stCharInClust; +#endif delete pgrseg; delete pgrtext; delete pchrp; @@ -197,82 +247,3 @@ } -#if 0 -GrResult GrSegment::GetUniscribePositions(int ichBase, IGrGraphics * pgg, - RECT rs, RECT rd, int cgidMax, int *pcgidRet, - int * prgxd, int * prgyd, int * prgdxdAdv) -{ - ChkGrArgPtr(pgg); - ChkGrOutPtr(pcgidRet); - ChkGrArrayArg(prgxd, cgidMax); - ChkGrArrayArg(prgyd, cgidMax); - ChkGrArrayArg(prgdxdAdv, cgidMax); - - GrResult res; - - SetUpGraphics(ichBase, pgg, true); - - if (m_fJustify) - { - res = ComputeDimensions(ichBase, pgg); - if (ResultFailed(res)) - { - RestoreFont(pgg); - ReturnResult(res); - } - } - - int cgbb = NumGbb(); - *pcgidRet = cgbb; - if (cgidMax < cgbb) - { - res = (cgidMax == 0) ? kresFalse : kresInvalidArg; - RestoreFont(pgg); - ReturnResult(res); - } - - if (m_dysAscent < 0) - { - res = ComputeDimensions(ichBase, pgg); - if (ResultFailed(res)) - { - RestoreFont(pgg); - ReturnResult(res); - } - } - - int * rgxdTmp = new int[cgidMax]; - int * rgdxdAdvTmp = new int[cgidMax]; - res = GetGlyphsAndPositions(ichBase, pgg, rs, rd, cgidMax, pcgidRet, - NULL, rgxdTmp, prgyd, rgdxdAdvTmp); - if (ResultFailed(res)) - { - delete[] rgxdTmp; - delete[] rgdxdAdvTmp; - RestoreFont(pgg); - ReturnResult(res); - } - - int xdLeft = ScaleX(0, rs, rd); - int xdXPosNatural = xdLeft; - for (int igbb = 0; igbb < *pcgidRet; igbb++) - { - int islout = SlotIndexForGbb(igbb); - GrSlotOutput * pslout = OutputSlot(islout); - int dxsAdvNatural = pslout->AdvanceXMetric(); - int dxdAdvNatural = ScaleX(dxsAdvNatural, rs, rd) - xdLeft; - prgdxdAdv[igbb] = dxdAdvNatural; - prgxd[igbb] = rgxdTmp[igbb] - xdXPosNatural; - - xdXPosNatural += dxdAdvNatural; - } - - delete[] rgxdTmp; - delete[] rgdxdAdvTmp; - - RestoreFont(pgg); - - ReturnResult(res); - -} -#endif |
From: <sil...@li...> - 2004-10-28 11:20:17
|
Update of /cvsroot/silgraphite/silgraphite/contrib/pangomod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9373 Modified Files: module.diff Log Message: really fix it Index: module.diff =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/pangomod/module.diff,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- module.diff 28 Oct 2004 10:42:55 -0000 1.3 +++ module.diff 28 Oct 2004 11:20:05 -0000 1.4 @@ -1,10 +1,10 @@ Index: pango/modules.c =================================================================== RCS file: /cvs/gnome/pango/pango/modules.c,v -retrieving revision 1.47 -diff -u -w -r1.47 modules.c ---- pango/modules.c 12 Nov 2003 08:42:43 -0000 1.47 -+++ pango/modules.c 28 Feb 2004 17:21:50 -0000 +retrieving revision 1.48 +diff -u -w -u -w -r1.48 modules.c +--- pango/modules.c 21 Jun 2004 18:25:26 -0000 1.48 ++++ pango/modules.c 28 Oct 2004 11:18:25 -0000 @@ -633,6 +633,10 @@ { PangoMapEntry *entry = NULL; @@ -12,7 +12,7 @@ + PangoMapEntry *preferred_entry = NULL; + + if (map->entries->len) -+ g_warning("got pango_map_engine is actually used"); ++ g_warning("got pango_map_engine is actually used"); if (script < map->entries->len) entry = &g_array_index (map->entries, PangoMapEntry, script); @@ -30,7 +30,7 @@ return pango_engine_pair_get_engine (entry->exact->data); else if (common_entry && common_entry->exact) return pango_engine_pair_get_engine (common_entry->exact->data); -@@ -690,16 +699,23 @@ +@@ -690,6 +699,7 @@ { PangoMapEntry *entry = NULL; PangoMapEntry *common_entry = NULL; @@ -38,13 +38,14 @@ if (script < map->entries->len) entry = &g_array_index (map->entries, PangoMapEntry, script); - +@@ -697,9 +707,15 @@ if (PANGO_SCRIPT_COMMON < map->entries->len) common_entry = &g_array_index (map->entries, PangoMapEntry, PANGO_SCRIPT_COMMON); + if (PANGO_SCRIPT_PREFERRED < map->entries->len) + preferred_entry = &g_array_index (map->entries, PangoMapEntry, PANGO_SCRIPT_PREFERRED); + ++ if (exact_engines) { *exact_engines = NULL; |
From: <sil...@li...> - 2004-10-28 10:43:04
|
Update of /cvsroot/silgraphite/silgraphite/contrib/pangomod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv622 Modified Files: module.diff Log Message: remove trace line Index: module.diff =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/pangomod/module.diff,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- module.diff 27 Oct 2004 17:00:13 -0000 1.2 +++ module.diff 28 Oct 2004 10:42:55 -0000 1.3 @@ -36,7 +36,6 @@ PangoMapEntry *common_entry = NULL; + PangoMapEntry *preferred_entry = NULL; -+ g_message("pango_map_get_engines"); if (script < map->entries->len) entry = &g_array_index (map->entries, PangoMapEntry, script); |
From: <sil...@li...> - 2004-10-27 17:04:07
|
Update of /cvsroot/silgraphite/silgraphite/contrib/pangomod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19466 Modified Files: README Log Message: PKG_CONFIG_PATH not DIR Index: README =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/pangomod/README,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- README 27 Oct 2004 17:00:13 -0000 1.4 +++ README 27 Oct 2004 17:03:47 -0000 1.5 @@ -28,7 +28,7 @@ export PATH=<prefix>/bin:$PATH export LD_LIBRARY_PATH=<prefix>/lib:$LD_LIBRARY_PATH -export PKG_CONFIG_DIR=<prefix>/lib/pkgconfig:$PKG_CONFIG_DIR +export PKG_CONFIG_PATH=<prefix>/lib/pkgconfig:$PKG_CONFIG_PATH Build and install fontconfig to <prefix> Build and install pango to <prefix> |
From: <sil...@li...> - 2004-10-27 17:00:23
|
Update of /cvsroot/silgraphite/silgraphite/contrib/pangomod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17169 Modified Files: Makefile.am README module.diff Log Message: change module patch to be for base pango dir update build instructions - thanks Greg install module to x.x.0 by default Index: Makefile.am =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/pangomod/Makefile.am,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile.am 25 Oct 2004 22:41:30 -0000 1.5 +++ Makefile.am 27 Oct 2004 17:00:13 -0000 1.6 @@ -14,7 +14,10 @@ EXTRA_DIST += $(top_srcdir)/*.h -moduledir = $(libdir)/silgraphite/pango/$(PANGO_MODULE_VERSION) +major=$(shell echo ${PANGO_MODULE_VERSION} | sed -e 's/\(^[0-9]*\)\.[0-9]*\.[0-9]*$$/\1/') +minor=$(shell echo ${PANGO_MODULE_VERSION} | sed -e 's/^[0-9]*\.\([0-9]*\)\.[0-9]*$$/\1/') + +moduledir = $(libdir)/silgraphite/pango/$(major).$(minor).0 module_LTLIBRARIES = pango-silgraphite-fc.la silgraphite_fc_sources = silgraphite-fc.c GrTextSrc.cpp \ Index: README =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/pangomod/README,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- README 25 Oct 2004 18:10:57 -0000 1.3 +++ README 27 Oct 2004 17:00:13 -0000 1.4 @@ -1,20 +1,17 @@ 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. -This means that if the pango-silgraphite module is installed then pango -can check if the font is a graphite font and hence use the graphite shaper -otherwise it will fallback to what it would normally have used. -It ought to work on pango/win32 as well though that is untested. However, -the graphite module is currently only expected to work on X11. - -Some debug code needs removed before I submit it. - -module.diff has debug removed, apply instead of pango.diff -_not_ as well as. +module.diff and script.diff are patch for pango to allow it to use a +module/engine declared as covering PANGO_SCRIPT_PREFERRED before any +other matching engine. This means that if the pango-silgraphite module +is installed then pango can check if the font is a graphite font and +hence use the graphite shaper otherwise it will fallback to what it +would normally have used. It ought to work on pango/win32 as well though +that is untested. However, the graphite module is currently only +expected to work on X11. -script.diff is the second part of the pango patch. +pango.diff is an alternative to module.diff which includes extra debug +trace code. fontconfig.diff is a patch for fontconfig to allow it to detect fonts with the Silf table and cache that information. @@ -38,7 +35,7 @@ Build and install silgraphite to <prefix> Build and install pangographite to <prefix> -Finally ou need to create a file ~/.pangorc which has +Finally you need to create a file ~/.pangorc which has [Pango] ModulesPath=<path to installed pangographite module>:<path to installed pango modules> @@ -49,4 +46,5 @@ 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. +Now when you run a program - try testtext, it should start using +graphite if it can. Index: module.diff =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/pangomod/module.diff,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- module.diff 12 Apr 2004 10:24:24 -0000 1.1 +++ module.diff 27 Oct 2004 17:00:13 -0000 1.2 @@ -1,10 +1,10 @@ -Index: modules.c +Index: pango/modules.c =================================================================== RCS file: /cvs/gnome/pango/pango/modules.c,v retrieving revision 1.47 diff -u -w -r1.47 modules.c ---- modules.c 12 Nov 2003 08:42:43 -0000 1.47 -+++ modules.c 28 Feb 2004 17:21:50 -0000 +--- pango/modules.c 12 Nov 2003 08:42:43 -0000 1.47 ++++ pango/modules.c 28 Feb 2004 17:21:50 -0000 @@ -633,6 +633,10 @@ { PangoMapEntry *entry = NULL; |
From: <sil...@li...> - 2004-10-27 14:32:45
|
Update of /cvsroot/silgraphite/silgraphite/contrib/fwviews In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11188/contrib/fwviews Modified Files: Tag: v2api GrTxtSrc.cpp GrTxtSrc.h Log Message: Synchronized with FW changelist #12044: began ITextSource rework Index: GrTxtSrc.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/fwviews/GrTxtSrc.cpp,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -u -d -r1.5 -r1.5.2.1 --- GrTxtSrc.cpp 6 Oct 2004 18:28:30 -0000 1.5 +++ GrTxtSrc.cpp 27 Oct 2004 14:31:59 -0000 1.5.2.1 @@ -28,27 +28,33 @@ //:>******************************************************************************************** //:>******************************************************************************************** -//:> Methods +//:> Methods: old interface //:>******************************************************************************************** /*---------------------------------------------------------------------------------------------- Constructors. ----------------------------------------------------------------------------------------------*/ -GrSimpleTextSource::GrSimpleTextSource(OLECHAR * pszText, GrCharProps & chrp, - OLECHAR * prgchFontVar, int ichFontVar) +GrSimpleTextSource::GrSimpleTextSource(gr::utf16 * pszText, + gr::utf16 * szFaceName, int ichFaceName, int pointSize, bool fBold, bool fItalic, bool fRtl) + //gr::utf16 * prgchFontVar, int ichFontVar) { - Assert(ichFontVar < isizeof(m_rgchFontVar)); + //Assert(ichFontVar < isizeof(m_rgchFontVar)); m_cref = 1; // COM-like behavior m_cchLength = wcslen(pszText); - m_prgchText = NewObj OLECHAR[m_cchLength + 1]; - memcpy(m_prgchText, pszText, isizeof(OLECHAR) * m_cchLength); + m_prgchText = NewObj gr::utf16[m_cchLength + 1]; + memcpy(m_prgchText, pszText, isizeof(gr::utf16) * m_cchLength); m_prgchText[m_cchLength] = 0; // zero-terminate - memcpy(&m_chrp, &chrp, isizeof(GrCharProps)); - memset(m_rgchFontVar, 0, isizeof(m_rgchFontVar)); - memcpy(m_rgchFontVar, prgchFontVar, min(ichFontVar, isizeof(m_rgchFontVar))); + wcscpy(m_szFaceName, szFaceName); + m_pointSize = pointSize; + m_fBold = fBold; + m_fItalic = fItalic; + m_fRtl = fRtl; + + //memset(m_rgchFontVar, 0, isizeof(m_rgchFontVar)); + //memcpy(m_rgchFontVar, prgchFontVar, min(ichFontVar, isizeof(m_rgchFontVar))); } @@ -86,7 +92,17 @@ ChkGrArgPtrN(pichLim); ChkGrArgPtrN(pichMin); - 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 = 0; // vertical offset + pchrp->ssv = kssvOff; // superscript + pchrp->clrFore = 0; + pchrp->clrBack = 0; // transparent + *pichMin = 0; *pichLim = m_cchLength; return kresOk; @@ -123,24 +139,95 @@ should be in effect for the given character. Also return the range of characters for which these variations are in effect; for this implementation that is the entire string. + This is simple implementaton of text-source does not support features. ----------------------------------------------------------------------------------------------*/ GrResult GrSimpleTextSource::GetFontVariations(int ich, - OLECHAR * prgchFontVar, int ichMax, int * pich, + OLECHAR * prgchFontVar, int ichMax, int * pcch, int * pichMin, int * pichLim) { ChkGrArgPtr(pichMin); ChkGrArgPtr(pichLim); ChkGrArrayArg(prgchFontVar, ichMax); - *pich = isizeof(m_rgchFontVar); - if (ichMax < *pich) - return kresFalse; - - memcpy(prgchFontVar, m_rgchFontVar, isizeof(m_rgchFontVar)); + //*pich = isizeof(m_rgchFontVar); + //if (ichMax < *pich) + // return kresFalse; + //memcpy(prgchFontVar, m_rgchFontVar, isizeof(m_rgchFontVar)); + *pcch = 0; *pichMin = 0; *pichLim = m_cchLength; return kresOk; } +//:>******************************************************************************************** +//:> Methods: new interface +//:>******************************************************************************************** + +/*---------------------------------------------------------------------------------------------- + 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 GrSimpleTextSource::getFaceName(int ich, unsigned int cchMax, + gr::utf16 * prgchFaceName, unsigned int * pcchLen) +{ + *pcchLen = wcslen(m_szFaceName); + if (*pcchLen >= cchMax) + return kresFail; // insufficient room in the buffer + + wcscpy(prgchFaceName, m_szFaceName); // includes zero-terminator + return kresOk; +} + +/*---------------------------------------------------------------------------------------------- + Return the size of the text, in points. +----------------------------------------------------------------------------------------------*/ +float GrSimpleTextSource::getFontSize(int ich) +{ + return (float)m_pointSize; +} + +/*---------------------------------------------------------------------------------------------- + Return true if the text is bold. +----------------------------------------------------------------------------------------------*/ +bool GrSimpleTextSource::getBold(int ich) +{ + return m_fBold; +} + +/*---------------------------------------------------------------------------------------------- + Return true if the text is italic. +----------------------------------------------------------------------------------------------*/ +bool GrSimpleTextSource::getItalic(int ich) +{ + return m_fItalic; +} + +/*---------------------------------------------------------------------------------------------- + Return true if the text uses a right-to-left writing system. +----------------------------------------------------------------------------------------------*/ +bool GrSimpleTextSource::getRightToLeft(int ich) +{ + return m_fRtl; +} + +/*---------------------------------------------------------------------------------------------- + Return the depth of embedding of the writing system. +----------------------------------------------------------------------------------------------*/ +unsigned int GrSimpleTextSource::getDirectionDepth(int ich) +{ + if (m_fRtl) + return 1; + else; + return 0; +} + +/*---------------------------------------------------------------------------------------------- + Return the vertical offset of the text. This simple implementation provides no + vertical offset. +----------------------------------------------------------------------------------------------*/ +float GrSimpleTextSource::getVerticalOffset(int ich) +{ + return 0; +} Index: GrTxtSrc.h =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/contrib/fwviews/GrTxtSrc.h,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -d -r1.4 -r1.4.2.1 --- GrTxtSrc.h 6 Oct 2004 18:28:30 -0000 1.4 +++ GrTxtSrc.h 27 Oct 2004 14:31:59 -0000 1.4.2.1 @@ -26,8 +26,10 @@ { public: // Constructor: - GrSimpleTextSource(OLECHAR * pszText, GrCharProps & chrp, - OLECHAR * prgchFontVar, int ichFontVar); + GrSimpleTextSource(gr::utf16 * pszText, + gr::utf16 * szFaceName, int ichFaceName, int pointSize, + bool fBold, bool fItalic, bool fRtl); + //gr::utf16 * prgchFontVar, int ichFontVar); ~GrSimpleTextSource(); virtual long IncRefCount(void) @@ -51,7 +53,7 @@ virtual GrResult GetParaProps(int ich, LgParaRenderProps * pchrp, int * pichMin, int * pichLim); virtual GrResult GetFontVariations(int ich, - OLECHAR * prgchFontVar, int ichMax, int * pich, + OLECHAR * prgchFontVar, int ichMax, int * pcch, int * pichMin, int * pichLim); // virtual GrResult GetCharStringProp(int ich, int id, // OLECHAR * prgch, int ichMax, int * pich, @@ -72,12 +74,52 @@ { } + // ------------------------------------------------------------------------------- + // New interface: + virtual GrResult getFaceName(int ich, unsigned int cchMax, + gr::utf16 * prgchFaceName, unsigned int * pcchLen); + virtual float getFontSize(int ich); + virtual bool getBold(int ich); + virtual bool getItalic(int ich); + virtual bool getRightToLeft(int ich); + virtual unsigned int getDirectionDepth(int ich); + virtual float getVerticalOffset(int ich); + + 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; // no features in this simple implementation + 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 = kclrBlack; + *pclrBack = kclrTransparent; + } + protected: long m_cref; - OLECHAR * m_prgchText; + gr::utf16 * m_prgchText; int m_cchLength; - OLECHAR m_rgchFontVar[64]; - GrCharProps m_chrp; + //gr::utf16 m_rgchFontVar[64]; + + gr::utf16 m_szFaceName[32]; + int m_pointSize; + bool m_fBold; + bool m_fItalic; + bool m_fRtl; + bool m_directionDepth; }; |