Kaydet (Commit) 23b9febb authored tarafından Martin Hosken's avatar Martin Hosken

Fix Graphite windows build static

Change-Id: I6feb3805e79f7cae4a8df7efa665fd97c56411c2
Reviewed-on: https://gerrit.libreoffice.org/18654Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMartin Hosken <martin_hosken@sil.org>
üst f2b93f2e
...@@ -20,7 +20,7 @@ $(eval $(call gb_StaticLibrary_set_include,graphite,\ ...@@ -20,7 +20,7 @@ $(eval $(call gb_StaticLibrary_set_include,graphite,\
$(eval $(call gb_StaticLibrary_add_defs,graphite,\ $(eval $(call gb_StaticLibrary_add_defs,graphite,\
-DGRAPHITE2_NTRACING \ -DGRAPHITE2_NTRACING \
-DGR2_STATIC \ -DGRAPHITE2_STATIC \
)) ))
ifeq ($(COM),GCC) ifeq ($(COM),GCC)
......
diff -ur graphite.org/src/inc/Main.h graphite/src/inc/Main.h
--- graphite.org/src/inc/Main.h 2015-09-07 20:09:25.572279671 +0700
--- graphite/src/inc/Main.h 2015-09-07 20:09:25.572279671 +0700
@@ -25,6 +25,7 @@
of the License or (at your option) any later version.
*/
#pragma once
+#pragma warning(disable: 4510 4610)
#include <cstdlib>
#include "graphite2/Types.h"
diff -ur graphite.org/src/inc/json.h graphite/src/inc/json.h diff -ur graphite.org/src/inc/json.h graphite/src/inc/json.h
--- graphite.org/src/inc/json.h 2015-02-03 14:49:24.408101900 +0100 --- graphite.org/src/inc/json.h 2015-02-03 14:49:24.408101900 +0100
+++ graphite/src/inc/json.h 2015-02-03 14:50:59.697552200 +0100 +++ graphite/src/inc/json.h 2015-02-03 14:50:59.697552200 +0100
......
...@@ -93,7 +93,7 @@ public: ...@@ -93,7 +93,7 @@ public:
private: private:
const gr_face * mpFace; // not owned by layout const gr_face * mpFace; // not owned by layout
gr_font * mpFont; // not owned by layout gr_font * mpFont; // not owned by layout
int mnSegCharOffset; // relative to ImplLayoutArgs::mpStr unsigned int mnSegCharOffset; // relative to ImplLayoutArgs::mpStr
long mnWidth; long mnWidth;
std::vector<int> mvChar2BaseGlyph; std::vector<int> mvChar2BaseGlyph;
std::vector<int> mvChar2Glyph; std::vector<int> mvChar2Glyph;
......
...@@ -148,14 +148,14 @@ GraphiteLayout::fillFrom(gr_segment * pSegment, ImplLayoutArgs &rArgs, float fSc ...@@ -148,14 +148,14 @@ GraphiteLayout::fillFrom(gr_segment * pSegment, ImplLayoutArgs &rArgs, float fSc
for ( ; baseSlot; baseSlot = nextBaseSlot) for ( ; baseSlot; baseSlot = nextBaseSlot)
{ {
thisBoundary = nextBoundary; thisBoundary = nextBoundary;
int firstChar = gr_slot_before(baseSlot) + mnSegCharOffset; int firstChar = gr_cinfo_base(gr_seg_cinfo(pSegment, gr_slot_before(baseSlot))) + mnSegCharOffset;
nextBaseSlot = get_next_base(bRtl ? gr_slot_prev_in_segment(baseSlot) : gr_slot_next_in_segment(baseSlot), bRtl); nextBaseSlot = get_next_base(bRtl ? gr_slot_prev_in_segment(baseSlot) : gr_slot_next_in_segment(baseSlot), bRtl);
nextBoundary = nextBaseSlot ? gr_slot_origin_X(nextBaseSlot) : gr_seg_advance_X(pSegment); nextBoundary = nextBaseSlot ? gr_slot_origin_X(nextBaseSlot) : gr_seg_advance_X(pSegment);
if (firstChar < mnMinCharPos || firstChar >= mnEndCharPos) if (firstChar < mnMinCharPos || firstChar >= mnEndCharPos)
continue; continue;
// handle reordered clusters. Presumes reordered glyphs have monotonic opposite char index until the cluster base. // handle reordered clusters. Presumes reordered glyphs have monotonic opposite char index until the cluster base.
bool isReordered = (nextBaseSlot && ((bRtl != (gr_slot_before(nextBaseSlot) < firstChar - mnSegCharOffset)) bool isReordered = (nextBaseSlot && ((bRtl != (gr_cinfo_base(gr_seg_cinfo(pSegment, gr_slot_before(nextBaseSlot))) < firstChar - mnSegCharOffset))
|| gr_slot_before(nextBaseSlot) == firstChar - mnSegCharOffset)); || gr_cinfo_base(gr_seg_cinfo(pSegment, gr_slot_before(nextBaseSlot))) == firstChar - mnSegCharOffset));
if (clusterStart >= 0 && !isReordered) // we hit the base (end) of a reordered cluster if (clusterStart >= 0 && !isReordered) // we hit the base (end) of a reordered cluster
{ {
int clusterEnd = mvGlyphs.size(); int clusterEnd = mvGlyphs.size();
...@@ -189,7 +189,7 @@ GraphiteLayout::fillFrom(gr_segment * pSegment, ImplLayoutArgs &rArgs, float fSc ...@@ -189,7 +189,7 @@ GraphiteLayout::fillFrom(gr_segment * pSegment, ImplLayoutArgs &rArgs, float fSc
} }
int baseGlyph = mvGlyphs.size(); int baseGlyph = mvGlyphs.size();
mvCharBreaks[firstChar - mnMinCharPos] = gr_cinfo_break_weight(gr_seg_cinfo(pSegment, firstChar - mnSegCharOffset)); mvCharBreaks[firstChar - mnMinCharPos] = gr_cinfo_break_weight(gr_seg_cinfo(pSegment, gr_slot_before(baseSlot)));
mvChar2BaseGlyph[firstChar - mnMinCharPos] = baseGlyph; mvChar2BaseGlyph[firstChar - mnMinCharPos] = baseGlyph;
mvCharDxs[firstChar - mnMinCharPos] = static_cast<int>((bRtl ? thisBoundary : nextBoundary) * fScaling) + mnWidth + nDxOffset; mvCharDxs[firstChar - mnMinCharPos] = static_cast<int>((bRtl ? thisBoundary : nextBoundary) * fScaling) + mnWidth + nDxOffset;
mvGlyph2Char[baseGlyph] = firstChar; mvGlyph2Char[baseGlyph] = firstChar;
...@@ -265,7 +265,7 @@ GraphiteLayout::append(gr_segment *pSeg, ImplLayoutArgs &rArgs, ...@@ -265,7 +265,7 @@ GraphiteLayout::append(gr_segment *pSeg, ImplLayoutArgs &rArgs,
{ {
assert(gi); assert(gi);
// assert(gr_slot_before(gi) <= gr_slot_after(gi)); // assert(gr_slot_before(gi) <= gr_slot_after(gi));
int firstChar = gr_slot_before(gi) + mnSegCharOffset; int firstChar = gr_cinfo_base(gr_seg_cinfo(pSeg, gr_slot_before(gi))) + mnSegCharOffset;
assert(mvGlyphs.size() < mvGlyph2Char.size()); assert(mvGlyphs.size() < mvGlyph2Char.size());
if (firstChar < mnMinCharPos || firstChar >= mnEndCharPos) if (firstChar < mnMinCharPos || firstChar >= mnEndCharPos)
return nextGlyphOrigin; return nextGlyphOrigin;
...@@ -274,7 +274,7 @@ GraphiteLayout::append(gr_segment *pSeg, ImplLayoutArgs &rArgs, ...@@ -274,7 +274,7 @@ GraphiteLayout::append(gr_segment *pSeg, ImplLayoutArgs &rArgs,
{ {
mvChar2BaseGlyph[firstChar - mnMinCharPos] = baseGlyph; mvChar2BaseGlyph[firstChar - mnMinCharPos] = baseGlyph;
mvCharDxs[firstChar - mnMinCharPos] = mvCharDxs[baseChar - mnMinCharPos]; mvCharDxs[firstChar - mnMinCharPos] = mvCharDxs[baseChar - mnMinCharPos];
mvCharBreaks[firstChar - mnMinCharPos] = gr_cinfo_break_weight(gr_seg_cinfo(pSeg, firstChar - mnSegCharOffset)); mvCharBreaks[firstChar - mnMinCharPos] = gr_cinfo_break_weight(gr_seg_cinfo(pSeg, gr_slot_before(gi)));
} }
long glyphId = gr_slot_gid(gi); long glyphId = gr_slot_gid(gi);
long deltaOffset = 0; long deltaOffset = 0;
...@@ -639,7 +639,8 @@ void GraphiteLayout::expandOrCondense(ImplLayoutArgs &rArgs) ...@@ -639,7 +639,8 @@ void GraphiteLayout::expandOrCondense(ImplLayoutArgs &rArgs)
int GraphiteLayout::ScanFwdForChar(int &findChar, bool fallback) const int GraphiteLayout::ScanFwdForChar(int &findChar, bool fallback) const
{ {
int res = mvChar2Glyph[findChar - mnMinCharPos]; int res = mvChar2Glyph[findChar - mnMinCharPos];
if (res == -1) int done = 3;
while (res == -1 && --done)
{ {
if (fallback) if (fallback)
{ {
...@@ -653,6 +654,7 @@ int GraphiteLayout::ScanFwdForChar(int &findChar, bool fallback) const ...@@ -653,6 +654,7 @@ int GraphiteLayout::ScanFwdForChar(int &findChar, bool fallback) const
if ((res = mvChar2Glyph[findChar - mnMinCharPos]) != -1) if ((res = mvChar2Glyph[findChar - mnMinCharPos]) != -1)
return res; return res;
} }
fallback = !fallback;
} }
return res; return res;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment