Draw: Workaround for backwards incompatibility of FT_Outline

This commit is contained in:
Mirek Fidler 2024-08-22 22:27:51 +02:00
parent a45eba27d0
commit 68139e3548
2 changed files with 4 additions and 5 deletions

View file

@ -65,7 +65,7 @@ bool FileMapping::Open(const char *filename, dword mode, int64 wsize, mode_t acm
if(!FileStream::OpenHandle(filename, mode, hfile, filesize, acm))
return false;
if((mode & FileStream::MODEMASK) == FileStream::CREATE) {
ftruncate(hfile, wsize);
(void)ftruncate(hfile, wsize);
filesize = wsize;
}
#endif

View file

@ -297,10 +297,9 @@ bool RenderOutline(const FT_Outline& outline, FontGlyphConsumer& path, double xx
FT_Vector v_start;
FT_Vector* point;
FT_Vector* limit;
char* tags;
int n; // index of contour in outline
char tag; // current point's state
int first = 0; // index of first point in contour
for(n = 0; n < outline.n_contours; n++) {
int last = outline.contours[n];
limit = outline.points + last;
@ -308,8 +307,8 @@ bool RenderOutline(const FT_Outline& outline, FontGlyphConsumer& path, double xx
v_last = outline.points[last];
v_control = v_start;
point = outline.points + first;
tags = outline.tags + first;
tag = FT_CURVE_TAG(tags[0]);
const auto *tags = outline.tags + first;
auto tag = FT_CURVE_TAG(tags[0]);
if(tag == FT_CURVE_TAG_CUBIC) return false;
if(tag == FT_CURVE_TAG_CONIC) {
if(FT_CURVE_TAG(outline.tags[last]) == FT_CURVE_TAG_ON) {