Jump to content

Recommended Posts

Posted

When using DynaPDF in FileMaker with MBS FileMaker Plugin, you can set the draw mode with the DynaPDF.SetTextDrawMode function. 

Each mode has one of three flags set:

  • Whether to draw the outline of the glyphs.
  • Whether to fill the outline of the glyphs.
  • Whether to apply the outline as clipping path.

The text draw mode specifies how text should be rendered. Texts can be used as clipping paths such as normal vector graphics; however, the usage is not the same. To use a text as clipping path save the graphics state, set the text draw mode to a clipping mode, paint the objects which should be clipped into the path and restore the graphics state.

Normal

Default, render the text in the usual way. The fill color is used as the text's color.

DrawMode0.jpg

Stroke

Tread the glyph outlines as path to be stroked. The current line width and stroke color are used to paint the path.

DrawMode1.jpg

FillStroke 

Tread the glyph outlines as path to be stroked and filled. The current line width, fill color, and stroke color are used to paint the path.

DrawMode2.jpg

Invisible 

Neither fill nor stroke the text, the text is invisible.

DrawMode3.jpg

FillClip 

Tread the glyph outlines as path to be filled and add this path to the current clipping path. The settings of the current line width and fill color are used to paint the path.

DrawMode4.jpg

We moved the drawn text a bit down right, so you csan see it.

StrokeClip 

Tread the glyph outlines as path to be stroked and add this path to the current clipping path. The settings of the current line width and stroke color are used to paint the path.

DrawMode5.jpg

FillStrokeClip 

Tread the glyph outlines as path to be stroked and filled and add this path to the current clipping path. The settings of the current line width, fill color and stroke color are used to paint the path.

DrawMode6.jpg

Clipping 

Tread the glyph outlines as path and add this path to the current clipping path. No text is drawn.

DrawMode7.jpg

If you try it, the code may be as easy as this:

# where?
Set Variable [ $x ; Value: 100 ] 
Set Variable [ $y ; Value: 100 ] 
# the text
Set Variable [ $text ; Value: "Some blue text" ] 
# set the font before measuring
Set Variable [ $r ; Value: MBS("DynaPDF.SetFont"; $pdf; "Helvetica"; 0; 12) ] 
# and draw text 
Set Variable [ $r ; Value: MBS("DynaPDF.SetFillColor"; $pdf; 0; 0; 1) // 100% blue ] 
Set Variable [ $r ; Value: MBS("DynaPDF.SetTextDrawMode"; $pdf; "Stroke") ] 
Set Variable [ $r ; Value: MBS("DynaPDF.WriteText"; $pdf; 100; $x; $text) ]

Please try and let us know if you have questions.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.