class Freetype::Stroker
- Freetype::Stroker
- Reference
- Object
Overview
FT_Stroker wrapper
This component generates stroked outlines of a given vectorial glyph. It also allows you to retrieve the 'outside' and/or the 'inside' borders of the stroke.
This can be useful to generate 'bordered' glyph, i.e., glyphs displayed with a coloured (and anti-aliased) border around their shape.
Defined in:
freetype/stroker.crConstructors
Instance Method Summary
-
#begin_subpath(to, open)
Start a new sub-path in the stroker.
-
#border_counts(border)
Call this function once you have finished parsing your paths with the stroker.
-
#conic_to(control, to)
'Draw' a single quadratic Bezier in the stroker's current sub-path, from the last position.
-
#counts
Call this function once you have finished parsing your paths with the stroker.
-
#cubic_to(control1, control2, to)
'Draw' a single quadratic Bezier in the stroker's current sub-path, from the last position.
-
#end_subpath
Close the current sub-path in the stroker.
-
#export(outline)
Call this function after get_border_counts to export all borders to your own 'Outline' structure.
-
#export_border(border, outline)
Call this function after 'get_border_counts' to export the corresponding border to your own 'Outline' structure.
- #finalize
-
#line_to(to)
'Draw' a single line segment in the stroker's current sub-path, from the last position.
-
#parse_outline(outline, opened = false)
A convenience function used to parse a whole outline with the stroker.
-
#rewind
Reset a stroker object without changing its attributes.
-
#set(radius, line_cap, line_join, miter_limit)
Reset a stroker object's attributes.
- #stroker : LibFreetype::FT_Stroker
Constructor Detail
Instance Method Detail
Start a new sub-path in the stroker.
Note:
This function is useful when you need to stroke a path that is not stored as an 'Outline' object.
Call this function once you have finished parsing your paths with the stroker. It returns the number of points and contours necessary to export one of the 'border' or 'stroke' outlines generated by the stroker.
'Draw' a single quadratic Bezier in the stroker's current sub-path, from the last position.
Note:
You should call this function between 'begin_subpath' and 'end_subpath'.
Call this function once you have finished parsing your paths with the stroker. It returns the number of points and contours necessary to export all points/borders from the stroked outline/path.
'Draw' a single quadratic Bezier in the stroker's current sub-path, from the last position.
Note:
You should call this function between 'begin_subpath' and 'end_subpath'.
Close the current sub-path in the stroker.
Note:
You should call this function after 'begin_subpath'. If the subpath was not 'opened', this function 'draws' a single line segment to the start position when needed.
Call this function after get_border_counts to export all borders to your own 'Outline' structure.
Note that this function appends the border points and contours to your outline, but does not try to resize its arrays.
Call this function after 'get_border_counts' to export the corresponding border to your own 'Outline' structure.
Note that this function appends the border points and contours to your outline, but does not try to resize its arrays.
Note:
Always call this function after get_border_counts to get sure that there is enough room in your 'Outline' object to receive all new data.
When an outline, or a sub-path, is 'closed', the stroker generates two independent 'border' outlines, named 'left' and 'right'.
When the outline, or a sub-path, is 'opened', the stroker merges the 'border' outlines with caps. The 'left' border receives all points, while the 'right' border becomes empty.
Use the function export instead if you want to retrieve all borders at once.
'Draw' a single line segment in the stroker's current sub-path, from the last position.
Note:
You should call this function between 'begin_subpath' and 'end_subpath'.
A convenience function used to parse a whole outline with the stroker. The resulting outline(s) can be retrieved later by functions like FT_Stroker_GetCounts and FT_Stroker_Export.
Note:
If 'opened' is 0 (the default), the outline is treated as a closed path, and the stroker generates two distinct 'border' outlines.
If 'opened' is 1, the outline is processed as an open path, and the stroker generates a single 'stroke' outline. This function calls 'rewind' automatically.
Reset a stroker object without changing its attributes. You should call this function before beginning a new series of calls to FT_Stroker_BeginSubPath or FT_Stroker_EndSubPath.