From 8516f1b516a309aebe2194af1c049dbfe76635e5 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Tue, 21 Mar 2017 14:58:43 +0100 Subject: 2017-03-21 14:27:00 --- tex/generic/context/luatex/luatex-fonts-merged.lua | 59 ++++++++++------------ 1 file changed, 28 insertions(+), 31 deletions(-) (limited to 'tex/generic') diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index d946dedfd..d5ea30f8b 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : c:/data/develop/context/sources/luatex-fonts-merged.lua -- parent file : c:/data/develop/context/sources/luatex-fonts.lua --- merge date : 03/20/17 17:33:01 +-- merge date : 03/21/17 14:21:12 do -- begin closure to overcome local limits and interference @@ -11784,11 +11784,10 @@ local function readnothing(f,nofcontours) } end local function curveto(m_x,m_y,l_x,l_y,r_x,r_y) - return { + return l_x+2/3*(m_x-l_x),l_y+2/3*(m_y-l_y), r_x+2/3*(m_x-r_x),r_y+2/3*(m_y-r_y), - r_x,r_y,"c" - } + r_x,r_y,"c" end local function applyaxis(glyph,shape,points,deltas) if points then @@ -11840,8 +11839,8 @@ local function applyaxis(glyph,shape,points,deltas) end end end +local quadratic=false local function contours2outlines_normal(glyphs,shapes) - local quadratic=true for index=1,#glyphs do local shape=shapes[index] if shape then @@ -11914,7 +11913,7 @@ local function contours2outlines_normal(glyphs,shapes) if quadratic then segments[nofsegments]={ x1,y1,x2,y2,"q" } else - x1,x2,x2,y2,px,py=curveto(x1,x2,px,py,x2,y2) + x1,y1,x2,y2,px,py=curveto(x1,y1,px,py,x2,y2) segments[nofsegments]={ x1,y1,x2,y2,px,py,"c" } end control_pt=false @@ -11925,7 +11924,7 @@ local function contours2outlines_normal(glyphs,shapes) if quadratic then segments[nofsegments]={ x1,y1,x2,y2,"q" } else - x1,x2,x2,y2,px,py=curveto(x1,x2,px,py,x2,y2) + x1,y1,x2,y2,px,py=curveto(x1,y1,px,py,x2,y2) segments[nofsegments]={ x1,y1,x2,y2,px,py,"c" } end control_pt=current_pt @@ -11935,16 +11934,16 @@ local function contours2outlines_normal(glyphs,shapes) if first_pt==last_pt then else nofsegments=nofsegments+1 + local x2,y2=first_pt[1],first_pt[2] if not control_pt then - segments[nofsegments]={ first_pt[1],first_pt[2],"l" } + segments[nofsegments]={ x2,y2,"l" } elseif quadratic then local x1,y1=control_pt[1],control_pt[2] - segments[nofsegments]={ x1,y1,first_pt[1],first_pt[2],"q" } + segments[nofsegments]={ x1,y1,x2,y2,"q" } else local x1,y1=control_pt[1],control_pt[2] - local x2,y2=first_pt[1],first_pt[2] - x1,x2,x2,y2,px,py=curveto(x1,x2,px,py,x2,y2) - segments[nofsegments]={ x1,y1,y2,y2,px,py,"c" } + x1,y1,x2,y2,px,py=curveto(x1,y1,px,py,x2,y2) + segments[nofsegments]={ x1,y1,x2,y2,px,py,"c" } end end end @@ -11957,7 +11956,6 @@ local function contours2outlines_normal(glyphs,shapes) end end local function contours2outlines_shaped(glyphs,shapes,keepcurve) - local quadratic=true for index=1,#glyphs do local shape=shapes[index] if shape then @@ -12048,7 +12046,7 @@ local function contours2outlines_shaped(glyphs,shapes,keepcurve) segments[nofsegments]={ x1,y1,x2,y2,"q" } end else - x1,x2,x2,y2,px,py=curveto(x1,x2,px,py,x2,y2) + x1,y1,x2,y2,px,py=curveto(x1,y1,px,py,x2,y2) if x1xmax then xmax=x1 end if y1ymax then ymax=y1 end if x2xmax then xmax=x2 end @@ -12072,7 +12070,7 @@ local function contours2outlines_shaped(glyphs,shapes,keepcurve) segments[nofsegments]={ x1,y1,x2,y2,"q" } end else - x1,x2,x2,y2,px,py=curveto(x1,x2,px,py,x2,y2) + x1,y1,x2,y2,px,py=curveto(x1,y1,px,py,x2,y2) if x1xmax then xmax=x1 end if y1ymax then ymax=y1 end if x2xmax then xmax=x2 end @@ -12094,27 +12092,26 @@ local function contours2outlines_shaped(glyphs,shapes,keepcurve) nofsegments=nofsegments+1 segments[nofsegments]={ first_pt[1],first_pt[2],"l" } end - elseif quadratic then - local x1,y1=control_pt[1],control_pt[2] - if x1xmax then xmax=x1 end - if y1ymax then ymax=y1 end - if keepcurve then - nofsegments=nofsegments+1 - segments[nofsegments]={ x1,y1,first_pt[1],first_pt[2],"q" } - end else local x1,y1=control_pt[1],control_pt[2] local x2,y2=first_pt[1],first_pt[2] - x1,x2,x2,y2,px,py=curveto(x1,x2,px,py,x2,y2) if x1xmax then xmax=x1 end if y1ymax then ymax=y1 end - if x2xmax then xmax=x2 end - if y2ymax then ymax=y2 end - if pxxmax then xmax=px end - if pyymax then ymax=py end - if keepcurve then - nofsegments=nofsegments+1 - segments[nofsegments]={ x1,y1,y2,y2,px,py,"c" } + if quadratic then + if keepcurve then + nofsegments=nofsegments+1 + segments[nofsegments]={ x1,y1,x2,y2,"q" } + end + else + x1,y1,x2,y2,px,py=curveto(x1,y1,px,py,x2,y2) + if x2xmax then xmax=x2 end + if y2ymax then ymax=y2 end + if pxxmax then xmax=px end + if pyymax then ymax=py end + if keepcurve then + nofsegments=nofsegments+1 + segments[nofsegments]={ x1,y1,x2,y2,px,py,"c" } + end end end end -- cgit v1.2.3