[PATCH] renderproto: Fix compositeglyph dst position. eliminate use of mask-format

Keith Packard keithp at keithp.com
Tue May 26 13:55:09 PDT 2015


Change the definition of composite glyphs from using an explicit
dst-x/dst-y location to match current implementation which uses the
dx/dy values from the first glyphitem for the destination location.

Define the source pattern origin to align with that first glyph
location.

Eliminate use of the mask-format in composite glyphs to clean up
rendering.

Signed-off-by: Keith Packard <keithp at keithp.com>
---
 renderproto.txt | 43 ++++++++++++++++---------------------------
 1 file changed, 16 insertions(+), 27 deletions(-)

diff --git a/renderproto.txt b/renderproto.txt
index 9f1f231..69368f6 100644
--- a/renderproto.txt
+++ b/renderproto.txt
@@ -231,7 +231,9 @@ PICTGLYPH	[
 			info:		GLYPHINFO
 			x, y:		INT16
 		]
-GLYPHABLE	GLYPHSET or FONTABLE
+GLYPHABLE	[
+			glyphset:	GLYPHSET
+		]
 GLYPHELT8	[
 			dx, dy:		INT16
 			glyphs:		LISTofCARD8
@@ -977,9 +979,8 @@ CompositeGlyphs32
 	src:		PICTURE
 	dst:		PICTURE
 	mask-format:	PICTFORMAT or None
-	glyphset:	GLYPHABLE
+	glyphset:	GLYPHSET
 	src-x, src-y:	INT16
-	dst-x, dst-y:	INT16
 	glyphcmds:	LISTofGLYPHITEM8	CompositeGlyphs8
 	glyphcmds:	LISTofGLYPHITEM16	CompositeGlyphs16
 	glyphcmds:	LISTofGLYPHITEM32	CompositeGlyphs32
@@ -987,32 +988,20 @@ CompositeGlyphs32
 	Errors:
 		Picture, PictOp, PictFormat, GlyphSet, Glyph
 
-	The dst-x and dst-y coordinates are relative to the drawable's
-	origin and specify the baseline starting position (the initial glyph
-	origin).  Each glyph item is processed in turn.  A glyphset item
-	causes the glyphset to be used for subsequent glyphs.  Switching
-	among glyphsets does not affect the next glyph origin.  A glyph
-	element delta-x and delta-y specify additional changes in the
-	position along the x and y axes before the string is drawn; the
-	deltas are always added to the glyph origin.
-
-	All contained GLYPHSETs are always transmitted most significant byte
-	first.  
-	
-	If a GlyphSet error is generated for an item, the previous items may
-	have been drawn.
-	
-	When mask-format is not None, glyphs are rendered in the following
-	way with the effective mask computed in mask-format:
+	The destination origin is set from the dx/dy members of the
+	first glyph item. Subsequent glyphs are offset by the
+	off-x/off-y elements from the previous glyph. Subsequent
+	glyphitems are additionally offset by their dx/dy members.
 
-		tmp = temporary alpha picture
-		Combine (Zero, tmp, tmp, None)
-		for each glyph
-			Combine (Add, tmp, glyph, None)
-		Combine (op, dst, source, tmp)
+	The src-x and src-y coordinates are relative to the source's
+	origin and register the pattern to the destination origin.
+
+	A GLYPHABLE item causes the glyphset to be used for subsequent
+	glyphs.  Switching among glyphsets does not affect the next
+	glyph origin.
 
-	When mask-format is None, glyphs are rendered in the order specified
-	directly to the destination:
+	Glyphs are rendered in the order specified directly to the
+	destination:
 
 		for each glyph
 			Combine (op, dst, source, glyph)
-- 
2.1.4



More information about the xorg-devel mailing list