Skip to content

foresight_backend_pdf ​

foresight_backend_pdf, PDF output device.

One page, drawn in the pixel space of the other devices: the page's matrix maps a pixel to 0.75 pt (96 px to the inch, as CSS) with y downward, so every coordinate is written as the SVG device writes it. The file is assembled in memory (no dates nor random identifiers: the same figure gives the same bytes), its content stream uncompressed, and renamed over <file> when the page ends. The plot area is a clipping path; the data in unit-square coordinates are mapped to its pixels; the overlays of the SVG device (error bar caps, point type markers, arrowheads, data labels) are drawn after the data, clipped to the plot area as there (markers whole across the border when one crosses it). Texts are set in the 14 standard fonts (Helvetica for the sans faces, Times for the serif ones, Symbol for gnuplot's /Symbol runs), WinAnsi encoded, placed with the compiled-in fonts' metrics. Groups hidden by the layout (a visible false) are not drawn; hypertext, pixmaps and 3D scenes, which need a viewer or a PNG decoder, are left out.

Source: src/lib/foresight_backend_pdf.F90

Dependencies

Contents ​

Variables ​

NameTypeAttributesDescription
PT_PER_PXreal(kind=R8P)parameterPoints per pixel (96 px to the inch).
CONTENTinteger(kind=I4P)parameterDestination: the page content.
CAPSinteger(kind=I4P)parameterDestination: the error bar caps of the plot area.
MARKSinteger(kind=I4P)parameterDestination: the point type markers of the plot area.
HEADSinteger(kind=I4P)parameterDestination: the arrowheads of the plot area.
LABELSinteger(kind=I4P)parameterDestination: the data labels of the plot area.
SYMBOL_FONTinteger(kind=I4P)parameterFont resource of gnuplot's Symbol runs.
BASE_FONTScharacter(len=*)parameterFonts.

Derived Types ​

backend_pdf ​

PDF output device.

Inheritance

Extends: backend_object

Components

NameTypeAttributesDescription
themetype(theme_object)Output theme: colors the layout's ones are mapped to (foresight_theme).
enhancedlogicalTexts read as gnuplot's enhanced text (foresight_enhanced).
latin1logicalTexts in ISO 8859-1, written in UTF-8 (set encoding iso_8859_1).
literallogicalThe texts written now as they are (an automatic title, noenhanced).
texlogicalTexts are LaTeX source, set by LaTeX (cairolatex): numbers in math mode.
text_sizereal(kind=R8P)Default font size of the texts [px].
boxedlogicalThe texts written now are boxed (gnuplot's textbox): on the background.
page_familycharacter(len=48)Font family of the page (set terminal ... font), empty: the device's.
fonttype(font_object)The font of the texts written now (gnuplot font "..."); unset parts the page's.
head_pxreal(kind=R8P)Length [px] and angle [deg] of the data arrowheads drawn now, 0 for the default head.
head_fixedlogicalThose heads keep their size on short arrows (gnuplot fixed).
embedlogicalTexts in the compiled-in fonts, embedded (Type 3, with their Unicode), else the standard fonts by name (fontnames: Helvetica, Times, Symbol).
line_scalereal(kind=R8P)Every line width times this (gnuplot pdfcairo linewidth).
dash_scalereal(kind=R8P)Every dash length times this (dashlength).
capcharacter(len=7)Line caps and joins: butt (miter joins), rounded, square.
monologicalMonochrome: lines and texts black, fills gray (mono).
latexlogicaldrawn (the PDF its graphics).
tex_filecharacter(len=:)allocatableThe LaTeX file (cairolatex).
tex_headercharacter(len=:)allocatableLaTeX code of the picture (header), empty for none.
tex_fontcharacter(len=:)allocatableLaTeX font name family,series,shape, empty for none.
tex_standalonelogicalA whole LaTeX document (standalone), else for \input.
tex_colortextlogicalTexts in their colors (colortext), else black.
tex_sizereal(kind=R8P)Font size of a standalone document [pt].
filecharacter(len=:)allocatableFinal output file.
pagereal(kind=R8P)Page width and height [px].
areareal(kind=R8P)Current plot area: left, top, width, height [px].
spilllogicalA marker of the current plot area crosses its border.
depthinteger(kind=I4P)Groups open.
hiddeninteger(kind=I4P)Depth of the hidden group drawn inside, 0 if none.
fontslogicalStandard font resources used.
font_refsinteger(kind=I4P)Their objects.
page_bytesinteger(kind=I1P)allocatablePage content stream.
page_usedinteger(kind=I4P)Its bytes in use.
caps_bytesinteger(kind=I1P)allocatableError bar caps of the plot area.
caps_usedinteger(kind=I4P)Its bytes in use.
marks_bytesinteger(kind=I1P)allocatablePoint type markers of the plot area.
marks_usedinteger(kind=I4P)Its bytes in use.
heads_bytesinteger(kind=I1P)allocatableArrowheads of the plot area.
heads_usedinteger(kind=I4P)Its bytes in use.
labels_bytesinteger(kind=I1P)allocatableData labels of the plot area.
labels_usedinteger(kind=I4P)Its bytes in use.
back_bytesinteger(kind=I1P)allocatablecairolatex: the \put lines of the back texts.
back_usedinteger(kind=I4P)Its bytes in use.
front_bytesinteger(kind=I1P)allocatablecairolatex: the \put lines of the front texts.
front_usedinteger(kind=I4P)Its bytes in use.
frontlogicalcairolatex: texts now in front (the panel's plot area open).
object_bytesinteger(kind=I1P)allocatableObjects made while drawing (images, masks, patterns), whole.
object_usedinteger(kind=I4P)Its bytes in use.
object_atinteger(kind=I4P)allocatableOffset of each of those objects in object_bytes.
objectsinteger(kind=I4P)Objects made while drawing; the first is object 5.
imagesinteger(kind=I4P)allocatableObject numbers of the image XObjects (/Im1, /Im2...).
nimagesinteger(kind=I4P)Images.
patternsinteger(kind=I4P)allocatableObject numbers of the tiling patterns (/P1, /P2...).
npatternsinteger(kind=I4P)Patterns.
pattern_lastinteger(kind=I4P)Pattern made last, 0 none.
pattern_keyinteger(kind=I8P)Its pattern, color and width, as one number.
glyph_faceinteger(kind=I4P)allocatableFace of each glyph used.
glyph_numberinteger(kind=I4P)allocatableIts glyph index in the face (0: a character no face has).
glyph_unicodeinteger(kind=I4P)allocatableThe character it shows.
glyph_rankinteger(kind=I4P)allocatableIts rank among the face's glyphs used, from 1.
nglyphsinteger(kind=I4P)Glyphs used.
face_glyphsinteger(kind=I4P)Glyphs used of each face (9: the math font).
font_objectsinteger(kind=I4P)Object number of each face's Type 3 fonts.
alphasreal(kind=R8P)allocatableOpacity of each graphics state (/GS1, /GS2...).
strokeslogicalallocatableWhether that opacity is the stroke's (CA), else the fill's (ca).
nalphasinteger(kind=I4P)Graphics states.

Type-Bound Procedures

NameAttributesDescription
rotates_textpass(self)Whether text can be rotated.
wants_scenepass(self)Whether 3D scenes are written.
scenepass(self)A 3D view's scene (JSON).
row_heightpass(self)Text row height, 0 if none.
hoverpass(self)Text on mouse-over of a point.
pixmappass(self)A PNG image [px].
begin_pagepass(self)Start the page of width x height px for file, its default font_size [px].
end_pagepass(self)Assemble the file (header, the catalog, the page tree, the page with its resources, its content, the objects made while drawing, the cross-reference table, the trailer) and publish it atomically.
begin_axespass(self)Open a panel: nothing to write (its geometry is the viewer's); cairolatex texts in the back until its plot area.
end_axespass(self)Close the panel.
begin_grouppass(self)Open a group: drawing inside a hidden one (visible false) is left out.
end_grouppass(self)Close the group.
rectpass(self)Rectangle of top-left corner (x, y) [px].
polylinepass(self)Open polyline through the points (x, y) [px].
dotspass(self)Filled round dots centred on the points (x, y) [px], or point type markers.
polygonpass(self)Closed polygon of the vertices (x, y) [px], filled and stroked; a ghost faintly filled only.
imagepass(self)Raster image over the box of top-left (x0, y0) and bottom-right (x1, y1) corners [px].
textpass(self)Text whose baseline passes through the anchor point (x, y) [px], ISO 8859-1 texts read as such (latin1).
begin_plot_areapass(self)Open the plot area: a clipping path over its pixels.
end_plot_areapass(self)Close the plot area, then draw its overlays: caps, markers (whole across the border if one crosses it, as the SVG device), arrowheads and data labels, clipped to the plot area.
data_polylinepass(self)Open polyline through the points (x, y) [unit square], round joins (as the SVG device).
data_dotspass(self)Round dots in the plot area, or point type markers queued for the markers' overlay.
data_barspass(self)Error bars [unit square]: the bars in the plot area, their caps in the caps' overlay.
data_polygonpass(self)Closed polygon of the vertices (x, y) [unit square], clipped by the plot area.
data_imagepass(self)Raster image over the box of bottom-left (x0, y0) and top-right (x1, y1) corners [unit square].
text_widthpass(self)Width of string with its superscript sup [px], from the compiled-in fonts, as the SVG device measures it.
readoutpass(self)Seven-segment readout of top-left corner (x, y) [px], as the SVG device draws it: the bold label above a glass slanted by 8 degrees, the unlit segments faint, the unit texts beside it.
readout_extentpass(self)Width and height [px] of a readout, as the SVG device's.
data_arrowspass(self)Arrows [unit square]: the shafts in the plot area, the heads (their pixel size) in the heads' overlay.
data_labelpass(self)Text anchored at a data point [unit square] moved by (dx, dy) [px], in the labels' overlay.
front_areapass(self)The front layer of the plot area: its clip again, after the overlays.
emitpass(self)Write to a destination buffer.
text_facepass(self)Face of the texts written now.
draw_textpass(self)A text at a pixel point, into a destination.
tex_putpass(self)A text of the LaTeX picture (cairolatex).
paint_pathpass(self)Fill and stroke a path, into a destination.
color_oppass(self)Fill or stroke color operator (with its opacity state).
alpha_statepass(self)Graphics state of an opacity.
add_objectpass(self)Append a whole object, return its number.
add_imagepass(self)An image XObject (and its mask): its resource name.
pattern_namepass(self)A tiling pattern of a fill pattern: its resource name.
markerspass(self)Point type markers at pixel points, into a destination.
visiblepass(self)Whether drawing is shown (no hidden group open).
glyph_slotpass(self)The font resource and code of a glyph, assigned on first use.
embed_fontspass(self)The Type 3 fonts of the glyphs used, as objects.

backend_pdf%rotates_text ​

Whether the device draws text rotated, as tick labels rotated by gnuplot: true but on text devices, which write them horizontally, as gnuplot's dumb terminal.

Attributes: pure

Returns: logical

fortran
function rotates_text(self) result(rotates)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_object)inDevice.

Call graph

backend_pdf%wants_scene ​

Whether the device writes the scene of a 3D view (the HTML page, for the viewer's mouse rotation): no.

Attributes: pure

Returns: logical

fortran
function wants_scene(self) result(wants)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_object)inDevice.

Call graph

backend_pdf%scene ​

The scene of a 3D view (foresight_scene3d's JSON), in the open panel: nothing on a device without a viewer.

fortran
subroutine scene(self, json)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_object)inoutDevice.
jsoncharacter(len=*)inScene.

Call graph

backend_pdf%row_height ​

Height of a text row of the device [px]: 0 on vector devices, where text sits anywhere.

Attributes: pure

Returns: real(kind=R8P)

fortran
function row_height(self) result(height)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_object)inDevice.

Call graph

backend_pdf%hover ​

text shown on mouse-over of the point (x, y) [unit square], a disk of diameter [px] (gnuplot's hypertext): nothing on a device without a mouse.

fortran
subroutine hover(self, x, y, text, diameter)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_object)inoutDevice.
xreal(kind=R8P)inAbscissa [unit].
yreal(kind=R8P)inOrdinate [unit].
textcharacter(len=*)inText.
diameterreal(kind=R8P)inSensitive disk [px].

backend_pdf%pixmap ​

The PNG image png (base64) with its top left corner at (x, y), width x height [px], stretched (gnuplot set pixmap): nothing on a device without images.

fortran
subroutine pixmap(self, x, y, width, height, png)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_object)inoutDevice.
xreal(kind=R8P)inLeft side [px].
yreal(kind=R8P)inTop side [px].
widthreal(kind=R8P)inWidth [px].
heightreal(kind=R8P)inHeight [px].
pngcharacter(len=*)inThe PNG file, base64.

Call graph

Subroutines ​

begin_page ​

Start the page of width x height px for file, its default font_size [px].

fortran
subroutine begin_page(self, file, width, height, font_size)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.
filecharacter(len=*)inOutput file.
widthreal(kind=R8P)inPage width [px].
heightreal(kind=R8P)inPage height [px].
font_sizereal(kind=R8P)inDefault font size [px].

Call graph

end_page ​

Assemble the file (header, the catalog, the page tree, the page with its resources, its content, the objects made while drawing, the cross-reference table, the trailer) and publish it atomically.

fortran
subroutine end_page(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.

Call graph

begin_axes ​

Open a panel: nothing to write (its geometry is the viewer's); cairolatex texts in the back until its plot area.

fortran
subroutine begin_axes(self, view)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.
viewtype(axes_view)inPanel geometry and axis ranges.

Call graph

end_axes ​

Close the panel.

fortran
subroutine end_axes(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.

Call graph

begin_group ​

Open a group: drawing inside a hidden one (visible false) is left out.

fortran
subroutine begin_group(self, name, visible, series)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.
namecharacter(len=*)inGroup name.
visiblelogicalinoptionalGroup shown.
seriesinteger(kind=I4P)inoptionalSeries number.

Call graph

end_group ​

Close the group.

fortran
subroutine end_group(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.

Call graph

rect ​

Rectangle of top-left corner (x, y) [px].

fortran
subroutine rect(self, x, y, width, height, stroke, fill, line_width)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.
xreal(kind=R8P)inLeft side [px].
yreal(kind=R8P)inTop side [px].
widthreal(kind=R8P)inWidth [px].
heightreal(kind=R8P)inHeight [px].
strokecharacter(len=*)inStroke color.
fillcharacter(len=*)inFill color.
line_widthreal(kind=R8P)inStroke width [px].

Call graph

polyline ​

Open polyline through the points (x, y) [px].

fortran
subroutine polyline(self, x, y, color, line_width, dasharray)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.
xreal(kind=R8P)inAbscissae [px].
yreal(kind=R8P)inOrdinates [px].
colorcharacter(len=*)inStroke color.
line_widthreal(kind=R8P)inStroke width [px].
dasharraycharacter(len=*)inSVG dash array, empty for solid.

Call graph

dots ​

Filled round dots centred on the points (x, y) [px], or point type markers.

fortran
subroutine dots(self, x, y, color, diameter, pt, line_width)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.
xreal(kind=R8P)inAbscissae [px].
yreal(kind=R8P)inOrdinates [px].
colorcharacter(len=*)inFill color.
diameterreal(kind=R8P)inDot diameter, or marker width [px].
ptinteger(kind=I4P)inoptionalgnuplot point type; negative or absent: round dots.
line_widthreal(kind=R8P)inoptionalMarker line width [px].

Call graph

polygon ​

Closed polygon of the vertices (x, y) [px], filled and stroked; a ghost faintly filled only.

fortran
subroutine polygon(self, x, y, fill, opacity, stroke, line_width, ghost)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.
xreal(kind=R8P)inVertex abscissae [px].
yreal(kind=R8P)inVertex ordinates [px].
fillcharacter(len=*)inFill color.
opacityreal(kind=R8P)inFill opacity.
strokecharacter(len=*)inBorder color.
line_widthreal(kind=R8P)inBorder width [px].
ghostlogicalinoptionalUnlit cell of a segmented fill.

Call graph

image ​

Raster image over the box of top-left (x0, y0) and bottom-right (x1, y1) corners [px].

fortran
subroutine image(self, x0, y0, x1, y1, rgba)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.
x0real(kind=R8P)inLeft [px].
y0real(kind=R8P)inTop [px].
x1real(kind=R8P)inRight [px].
y1real(kind=R8P)inBottom [px].
rgbainteger(kind=I4P)inPixels.

Call graph

text ​

Text whose baseline passes through the anchor point (x, y) [px], ISO 8859-1 texts read as such (latin1).

fortran
subroutine text(self, x, y, string, anchor, sup, rotate, color)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.
xreal(kind=R8P)inAnchor abscissa [px].
yreal(kind=R8P)inAnchor ordinate (baseline) [px].
stringcharacter(len=*)inText.
anchorcharacter(len=*)inHorizontal anchor: start, middle or end.
supcharacter(len=*)inoptionalSuperscript appended to string.
rotatereal(kind=R8P)inoptionalRotation about the anchor point [deg, clockwise].
colorcharacter(len=*)inoptionalText color, the frame's if absent.

Call graph

begin_plot_area ​

Open the plot area: a clipping path over its pixels.

fortran
subroutine begin_plot_area(self, x, y, width, height)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.
xreal(kind=R8P)inLeft side [px].
yreal(kind=R8P)inTop side [px].
widthreal(kind=R8P)inWidth [px].
heightreal(kind=R8P)inHeight [px].

Call graph

end_plot_area ​

Close the plot area, then draw its overlays: caps, markers (whole across the border if one crosses it, as the SVG device), arrowheads and data labels, clipped to the plot area.

fortran
subroutine end_plot_area(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.

Call graph

data_polyline ​

Open polyline through the points (x, y) [unit square], round joins (as the SVG device).

fortran
subroutine data_polyline(self, x, y, color, line_width, dasharray)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.
xreal(kind=R8P)inAbscissae [unit].
yreal(kind=R8P)inOrdinates [unit].
colorcharacter(len=*)inStroke color.
line_widthreal(kind=R8P)inStroke width [px].
dasharraycharacter(len=*)inSVG dash array, empty for solid.

Call graph

data_dots ​

Round dots in the plot area, or point type markers queued for the markers' overlay.

fortran
subroutine data_dots(self, x, y, color, diameter, pt, line_width)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.
xreal(kind=R8P)inAbscissae [unit].
yreal(kind=R8P)inOrdinates [unit].
colorcharacter(len=*)inFill color.
diameterreal(kind=R8P)inDot diameter, or marker width [px].
ptinteger(kind=I4P)inoptionalgnuplot point type; negative or absent: round dots.
line_widthreal(kind=R8P)inoptionalMarker line width [px].

Call graph

data_bars ​

Error bars [unit square]: the bars in the plot area, their caps in the caps' overlay.

fortran
subroutine data_bars(self, x1, y1, x2, y2, color, line_width, cap, vertical)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.
x1real(kind=R8P)inBar start abscissae.
y1real(kind=R8P)inBar start ordinates.
x2real(kind=R8P)inBar end abscissae.
y2real(kind=R8P)inBar end ordinates.
colorcharacter(len=*)inStroke color.
line_widthreal(kind=R8P)inStroke width [px].
capreal(kind=R8P)inCap length [px].
verticallogicalinVertical bars (horizontal caps), else horizontal.

Call graph

data_polygon ​

Closed polygon of the vertices (x, y) [unit square], clipped by the plot area.

fortran
subroutine data_polygon(self, x, y, fill, opacity, stroke, line_width, ghost)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.
xreal(kind=R8P)inVertex abscissae [unit].
yreal(kind=R8P)inVertex ordinates [unit].
fillcharacter(len=*)inFill color.
opacityreal(kind=R8P)inFill opacity.
strokecharacter(len=*)inBorder color.
line_widthreal(kind=R8P)inBorder width [px].
ghostlogicalinoptionalUnlit cell of a segmented fill.

Call graph

data_image ​

Raster image over the box of bottom-left (x0, y0) and top-right (x1, y1) corners [unit square].

fortran
subroutine data_image(self, x0, y0, x1, y1, rgba)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.
x0real(kind=R8P)inLeft [unit].
y0real(kind=R8P)inBottom [unit].
x1real(kind=R8P)inRight [unit].
y1real(kind=R8P)inTop [unit].
rgbainteger(kind=I4P)inPixels.

Call graph

readout ​

Seven-segment readout of top-left corner (x, y) [px], as the SVG device draws it: the bold label above a glass slanted by 8 degrees, the unlit segments faint, the unit texts beside it.

fortran
subroutine readout(self, x, y, height, masks, label, prefix, suffix, color, font_size)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.
xreal(kind=R8P)inLeft side [px].
yreal(kind=R8P)inTop side [px].
heightreal(kind=R8P)inDigit height [px].
masksinteger(kind=I4P)inSegments of each cell.
labelcharacter(len=*)inLabel, empty for none.
prefixcharacter(len=*)inText before the glass.
suffixcharacter(len=*)inText after the glass.
colorcharacter(len=*)inColor of the lit segments.
font_sizereal(kind=R8P)inFont size of the texts [px].

Call graph

data_arrows ​

Arrows [unit square]: the shafts in the plot area, the heads (their pixel size) in the heads' overlay.

fortran
subroutine data_arrows(self, x1, y1, x2, y2, color, line_width, head, filled)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.
x1real(kind=R8P)inTail abscissae [unit].
y1real(kind=R8P)inTail ordinates [unit].
x2real(kind=R8P)inTip abscissae [unit].
y2real(kind=R8P)inTip ordinates [unit].
colorcharacter(len=*)inStroke color.
line_widthreal(kind=R8P)inStroke width [px].
headinteger(kind=I4P)inHeads: 0 none, 1 end, 2 start, 3 both.
filledlogicalinFilled heads.

Call graph

data_label ​

Text anchored at a data point [unit square] moved by (dx, dy) [px], in the labels' overlay.

fortran
subroutine data_label(self, x, y, string, anchor, rotate, color, dx, dy)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.
xreal(kind=R8P)inAnchor abscissa [unit].
yreal(kind=R8P)inAnchor ordinate [unit].
stringcharacter(len=*)inText.
anchorcharacter(len=*)inHorizontal anchor: start, middle or end.
rotatereal(kind=R8P)inRotation [deg, counterclockwise].
colorcharacter(len=*)inText color.
dxreal(kind=R8P)inHorizontal offset [px].
dyreal(kind=R8P)inVertical offset [px, downward].

Call graph

front_area ​

Open (opening) or close the front layer of the plot area, drawn after its overlays (gnuplot's front objects over the markers): the plot area's clipping path again.

fortran
subroutine front_area(self, opening, separate)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.
openinglogicalinOpen, else close.
separatelogicaloutA layer of its own.

Call graph

emit ​

Append text to the destination buffer, unless inside a hidden group.

fortran
subroutine emit(self, destination, text)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.
destinationinteger(kind=I4P)inCONTENT, CAPS, MARKS, HEADS or LABELS.
textcharacter(len=*)inText.

Call graph

draw_text ​

The UTF-8 string with its superscript sup, its baseline through (x, y) [px] anchored by anchor, rotated by rotate [deg, clockwise] about that point, in color, into destination: enhanced text by its runs (their sizes, shifts, step-backs, faces; invisible ones skipped), each run in the standard font of its face (Symbol for gnuplot's Symbol runs), placed by the compiled-in fonts' advances; a boxed text over the page color.

fortran
subroutine draw_text(self, destination, x, y, string, anchor, sup, rotate, color)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.
destinationinteger(kind=I4P)inDestination buffer.
xreal(kind=R8P)inAnchor abscissa [px].
yreal(kind=R8P)inBaseline [px].
stringcharacter(len=*)inText, UTF-8.
anchorcharacter(len=*)instart, middle or end.
supcharacter(len=*)inSuperscript, empty for none.
rotatereal(kind=R8P)inRotation [deg, clockwise].
colorcharacter(len=*)inColor.

Call graph

tex_put ​

The text string (LaTeX, its superscript sup raised) of the LaTeX picture, as gnuplot's epslatex texts: its center (gnuplot's vertical anchor, 0.35 base above foresight's baseline) by \put in 0.05 bp from the bottom left, \makebox(0,0)[l|r]{\strut{}...} (a text opening with { or [ its own box), \rotatebox [deg, counterclockwise], its color by \colorrgb (shown or not by \ifGPblacktext), else the frame's; in the back texts until the panel's plot area opens.

fortran
subroutine tex_put(self, x, y, string, anchor, sup, rotate, color, base)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.
xreal(kind=R8P)inAnchor abscissa [px].
yreal(kind=R8P)inBaseline [px].
stringcharacter(len=*)inText, LaTeX.
anchorcharacter(len=*)instart, middle or end.
supcharacter(len=*)inSuperscript, empty for none.
rotatereal(kind=R8P)inRotation [deg, clockwise].
colorcharacter(len=*)inColor.
basereal(kind=R8P)inFont size [px].

Call graph

paint_path ​

Fill (fill at opacity, unless none) and stroke (stroke line_width px wide, dashed by the SVG dasharray, unless none) the path (PDF path operators, closed by the caller where needed), into destination, in its own graphics state; join 0 miter, 1 round.

fortran
subroutine paint_path(self, destination, path, fill, opacity, stroke, line_width, dasharray, join)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.
destinationinteger(kind=I4P)inDestination buffer.
pathcharacter(len=*)inPath operators.
fillcharacter(len=*)inFill color, a pattern fill, or none.
opacityreal(kind=R8P)inFill opacity.
strokecharacter(len=*)inStroke color or none.
line_widthreal(kind=R8P)inStroke width [px].
dasharraycharacter(len=*)inSVG dash array, empty for solid.
joininteger(kind=I4P)inLine join.

Call graph

markers ​

The markers of gnuplot point type pt (marker_path, the SVG device's shapes) centred on (x, y) [px], into destination: the filled shapes (the dot, odd types from 5) filled and stroked, the others stroked.

fortran
subroutine markers(self, destination, x, y, color, diameter, pt, line_width)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.
destinationinteger(kind=I4P)inDestination buffer.
xreal(kind=R8P)inAbscissae [px].
yreal(kind=R8P)inOrdinates [px].
colorcharacter(len=*)inColor.
diameterreal(kind=R8P)inMarker width [px].
ptinteger(kind=I4P)inPoint type, >= 0.
line_widthreal(kind=R8P)inLine width [px].

Call graph

glyph_slot ​

The font resource name (E<face>_<n>) and code (1-255) of the glyph glyph of face showing unicode (glyph 0: a character no face has, drawn as nothing 0.556 em wide), assigned on its first use.

fortran
subroutine glyph_slot(self, face, glyph, unicode, name, code)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.
faceinteger(kind=I4P)inFace, 1-8.
glyphinteger(kind=I4P)inGlyph index, 0 none.
unicodeinteger(kind=I4P)inCharacter.
namecharacter(len=:)outallocatableFont resource.
codeinteger(kind=I4P)outCode in that font.

Call graph

embed_fonts ​

The Type 3 fonts of the glyphs used: for each face and each 255 of its glyphs, a font of 1000 units to the em whose glyph procedures fill the outlines (quadratic segments as cubic ones), its widths, and a ToUnicode map (the text is selectable and searchable). Their object numbers go to font_objects.

fortran
subroutine embed_fonts(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.

Call graph

round_dots ​

Filled round dots of diameter [px] centred on (x, y) [px]: zero-length segments with round caps.

fortran
subroutine round_dots(self, destination, x, y, color, diameter)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.
destinationinteger(kind=I4P)inDestination buffer.
xreal(kind=R8P)inAbscissae [px].
yreal(kind=R8P)inOrdinates [px].
colorcharacter(len=*)inColor.
diameterreal(kind=R8P)inDiameter [px].

Call graph

polygon_at ​

Closed polygon of the vertices (x, y) [px]: filled and stroked in the theme colors; a ghost faintly filled.

fortran
subroutine polygon_at(self, x, y, fill, opacity, stroke, line_width, ghost)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.
xreal(kind=R8P)inVertex abscissae [px].
yreal(kind=R8P)inVertex ordinates [px].
fillcharacter(len=*)inFill color.
opacityreal(kind=R8P)inFill opacity.
strokecharacter(len=*)inBorder color.
line_widthreal(kind=R8P)inBorder width [px].
ghostlogicalinoptionalUnlit cell of a segmented fill.

Call graph

draw_image ​

rgba stretched over the box from (left, top) to (right, bottom) [px], its first row at the top.

fortran
subroutine draw_image(self, left, top, right, bottom, rgba)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.
leftreal(kind=R8P)inLeft [px].
topreal(kind=R8P)inTop [px].
rightreal(kind=R8P)inRight [px].
bottomreal(kind=R8P)inBottom [px].
rgbainteger(kind=I4P)inPixels.

Call graph

decode ​

The code point of the UTF-8 character at byte k of text and its bytes (a malformed byte: its own code).

Attributes: pure

fortran
subroutine decode(text, k, code, n)

Arguments

NameTypeIntentAttributesDescription
textcharacter(len=*)inUTF-8 text.
kinteger(kind=I4P)inFirst byte.
codeinteger(kind=I4P)outCode point.
ninteger(kind=I4P)outBytes.

Call graph

add_bytes ​

Append bytes to buffer(1:used), grown by doubling.

Attributes: pure

fortran
subroutine add_bytes(buffer, used, bytes)

Arguments

NameTypeIntentAttributesDescription
bufferinteger(kind=I1P)inoutallocatableBuffer.
usedinteger(kind=I4P)inoutBytes in use.
bytesinteger(kind=I1P)inBytes.

Call graph

add_text ​

Append the characters of text to buffer(1:used), grown by doubling.

Attributes: pure

fortran
subroutine add_text(buffer, used, text)

Arguments

NameTypeIntentAttributesDescription
bufferinteger(kind=I1P)inoutallocatableBuffer.
usedinteger(kind=I4P)inoutBytes in use.
textcharacter(len=*)inText.

Call graph

Functions ​

text_width ​

Width of string with its superscript sup [px], from the compiled-in fonts, as the SVG device measures it.

Attributes: pure

Returns: real(kind=R8P)

fortran
function text_width(self, string, sup, font_size) result(width)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inDevice.
stringcharacter(len=*)inText.
supcharacter(len=*)inSuperscript.
font_sizereal(kind=R8P)inFont size [px].

Call graph

readout_extent ​

Width and height [px] of a readout, as the SVG device's.

Attributes: pure

Returns: real(kind=R8P)

fortran
function readout_extent(self, height, cells, label, prefix, suffix, font_size) result(extent)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inDevice.
heightreal(kind=R8P)inDigit height [px].
cellsinteger(kind=I4P)inGlass cells.
labelcharacter(len=*)inLabel, empty for none.
prefixcharacter(len=*)inText before the glass.
suffixcharacter(len=*)inText after the glass.
font_sizereal(kind=R8P)inFont size of the texts [px].

Call graph

visible ​

Whether drawing is shown: no hidden group open.

Attributes: pure

Returns: logical

fortran
function visible(self) result(shown_now)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inDevice.

Call graph

text_face ​

The compiled-in face (1-8) of the texts written now: self%font, its family the page's when unset.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function text_face(self) result(face)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inDevice.

Call graph

color_op ​

r g b rg (or RG for a stroke) of the color color, #rrggbbaa with its opacity state; unknown colors black.

Returns: character(len=:)

fortran
function color_op(self, color, stroke) result(op)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.
colorcharacter(len=*)inColor.
strokelogicalinStroke color, else fill.

Call graph

alpha_state ​

The graphics state resource (GS<n>) of the fill (or stroke) opacity alpha, made once.

Returns: character(len=:)

fortran
function alpha_state(self, alpha, stroke) result(name)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.
alphareal(kind=R8P)inOpacity.
strokelogicalinStroke opacity, else fill.

Call graph

add_object ​

Append the object body (a dictionary), followed by stream if present, as the next object made while drawing: its number (5 the first).

Returns: integer(kind=I4P)

fortran
function add_object(self, body, stream) result(number)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.
bodycharacter(len=*)inDictionary.
streaminteger(kind=I1P)inoptionalStream data.

Call graph

add_image ​

An image XObject of rgba(channel, column, row) (rows top to bottom), 8-bit RGB samples uncompressed, with a soft mask of its alpha when not opaque: its resource name (Im<n>).

Returns: character(len=:)

fortran
function add_image(self, rgba) result(name)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.
rgbainteger(kind=I4P)inPixels.

Call graph

pattern_name ​

The tiling pattern of gnuplot's fill pattern kind in color, lines line_width px wide (1 px if not positive): the 8 px tile of the SVG device, in page pixels; made again only when pattern, color or width change.

Returns: character(len=:)

fortran
function pattern_name(self, kind, color, line_width) result(name)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inoutDevice.
kindinteger(kind=I4P)inPattern number.
colorcharacter(len=*)inLine color.
line_widthreal(kind=R8P)inLine width [px].

Call graph

outline_ops ​

The fill of a glyph outline (operations 0 move, 1 line, 2 quadratic, 3 cubic, 4 close; points already scaled) and its box (left, bottom, right, top).

Returns: character(len=:)

fortran
function outline_ops(ops, points, box) result(path)

Arguments

NameTypeIntentAttributesDescription
opsinteger(kind=I4P)inOperations.
pointsreal(kind=R8P)inPoints, x then y.
boxreal(kind=R8P)outBox.

Call graph

to_unicode ​

The ToUnicode CMap of entries (<code> <unicode> lines), codes 1 to count, in blocks of 100 (the limit of a beginbfchar block).

Attributes: pure

Returns: character(len=:)

fortran
function to_unicode(entries, count) result(cmap)

Arguments

NameTypeIntentAttributesDescription
entriescharacter(len=*)inLines.
countinteger(kind=I4P)inCodes.

Call graph

hex2 ​

value (0-255) as two hexadecimal digits.

Attributes: pure

Returns: character(len=2)

fortran
function hex2(value) result(text)

Arguments

NameTypeIntentAttributesDescription
valueinteger(kind=I4P)inValue.

Call graph

utf16 ​

The UTF-16 code units of the code point value, in hexadecimal: four digits, eight for a surrogate pair.

Attributes: pure

Returns: character(len=:)

fortran
function utf16(value) result(text)

Arguments

NameTypeIntentAttributesDescription
valueinteger(kind=I4P)inCode point.

Call graph

hex4 ​

value (0-65535) as four hexadecimal digits.

Attributes: pure

Returns: character(len=4)

fortran
function hex4(value) result(text)

Arguments

NameTypeIntentAttributesDescription
valueinteger(kind=I4P)inValue.

Call graph

map_fill ​

The theme color of a fill, a pattern fill's color mapped inside it.

Returns: character(len=:)

fortran
function map_fill(self, fill) result(mapped)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inDevice.
fillcharacter(len=*)inFill.

Call graph

glass_geometry ​

Glass of a readout of top-left corner (x, y), as the SVG device's.

Attributes: pure

Returns: real(kind=R8P)

fortran
function glass_geometry(self, x, y, height, cells, label, prefix, font_size) result(geometry)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inDevice.
xreal(kind=R8P)inLeft side [px].
yreal(kind=R8P)inTop side [px].
heightreal(kind=R8P)inDigit height [px].
cellsinteger(kind=I4P)inGlass cells.
labelcharacter(len=*)inLabel, empty for none.
prefixcharacter(len=*)inText before the glass.
font_sizereal(kind=R8P)inFont size of the texts [px].

Call graph

resource_dictionary ​

The page's resources: the fonts used, the opacity states, the images, the patterns.

Returns: character(len=:)

fortran
function resource_dictionary(self) result(dictionary)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inDevice.

Call graph

clip_box ​

The plot area as the clipping path.

Attributes: pure

Returns: character(len=:)

fortran
function clip_box(self) result(ops)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inDevice.

Call graph

page_x ​

Pixel abscissae of the unit-square abscissae u of the plot area.

Attributes: pure

Returns: real(kind=R8P)

fortran
function page_x(self, u) result(x)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inDevice.
ureal(kind=R8P)inAbscissae [unit].

Call graph

page_y ​

Pixel ordinates of the unit-square ordinates v (upward) of the plot area.

Attributes: pure

Returns: real(kind=R8P)

fortran
function page_y(self, v) result(y)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inDevice.
vreal(kind=R8P)inOrdinates [unit].

Call graph

page_x1 ​

Pixel abscissa of the unit-square abscissa u.

Attributes: pure

Returns: real(kind=R8P)

fortran
function page_x1(self, u) result(x)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inDevice.
ureal(kind=R8P)inAbscissa [unit].

Call graph

page_y1 ​

Pixel ordinate of the unit-square ordinate v.

Attributes: pure

Returns: real(kind=R8P)

fortran
function page_y1(self, v) result(y)

Arguments

NameTypeIntentAttributesDescription
selfclass(backend_pdf)inDevice.
vreal(kind=R8P)inOrdinate [unit].

Call graph

path_of ​

Path operators through the points (x, y) [px], closed or open; non-finite points are skipped.

Returns: character(len=:)

fortran
function path_of(x, y, closed) result(path)

Arguments

NameTypeIntentAttributesDescription
xreal(kind=R8P)inAbscissae [px].
yreal(kind=R8P)inOrdinates [px].
closedlogicalinClosed.

Call graph

svg_path ​

PDF path operators of the SVG path data d of foresight's shapes: M, L, H, V (absolute), h, v (relative), Z, and A half circles (two make a marker's circle), each written as two Bezier quarter arcs.

Returns: character(len=:)

fortran
function svg_path(d) result(path)

Arguments

NameTypeIntentAttributesDescription
dcharacter(len=*)inSVG path data.

Call graph

dashes ​

The PDF dash array of an SVG one (4,2 -> 4 2), its lengths times scale (1 leaves them as written).

Returns: character(len=:)

fortran
function dashes(dasharray, scale) result(list)

Arguments

NameTypeIntentAttributesDescription
dasharraycharacter(len=*)inSVG dash array.
scalereal(kind=R8P)inLength factor.

Call graph

pdf_string ​

The PDF literal string of the UTF-8 text: WinAnsi codes (Latin-1 and the typographic characters of 128-159), ? for a character WinAnsi lacks, raw bytes for the Symbol font (symbol); (, ) and \ escaped, codes above 126 written as octal escapes (the content stream stays ASCII).

Attributes: pure

Returns: character(len=:)

fortran
function pdf_string(text, symbol) result(literal)

Arguments

NameTypeIntentAttributesDescription
textcharacter(len=*)inText, UTF-8.
symbollogicalinIn the Symbol font: the bytes as they are.

Call graph

winansi ​

The WinAnsi code of the code point code, ? (63) if it has none.

Attributes: elemental

Returns: integer(kind=I4P)

fortran
function winansi(code) result(w)

Arguments

NameTypeIntentAttributesDescription
codeinteger(kind=I4P)inCode point.

Call graph

text_bytes ​

The bytes of text.

Attributes: pure

Returns: integer(kind=I1P)

fortran
function text_bytes(text) result(bytes)

Arguments

NameTypeIntentAttributesDescription
textcharacter(len=*)inText.

Call graph

byte ​

The byte of value in 0..255.

Attributes: elemental

Returns: integer(kind=I1P)

fortran
function byte(value) result(b)

Arguments

NameTypeIntentAttributesDescription
valueinteger(kind=I4P)inValue.

Call graph

digits10 ​

value on 10 digits, zero-padded (a cross-reference offset).

Attributes: pure

Returns: character(len=10)

fortran
function digits10(value) result(text)

Arguments

NameTypeIntentAttributesDescription
valueinteger(kind=I4P)inValue.

Call graph

point ​

x y [px].

Attributes: pure

Returns: character(len=:)

fortran
function point(x, y) result(text)

Arguments

NameTypeIntentAttributesDescription
xreal(kind=R8P)inAbscissa.
yreal(kind=R8P)inOrdinate.

Call graph

bytes_text ​

The first n bytes of bytes as characters.

Attributes: pure

Returns: character(len=:)

fortran
function bytes_text(bytes, n) result(text)

Arguments

NameTypeIntentAttributesDescription
bytesinteger(kind=I1P)inBytes.
ninteger(kind=I4P)inBytes in use.

num ​

A number of the content: 3 decimals at most, trailing zeros stripped (foresight_format fixed).

Attributes: pure

Returns: character(len=:)

fortran
function num(v) result(text)

Arguments

NameTypeIntentAttributesDescription
vreal(kind=R8P)inValue.

Call graph

Released under the GPL v3, BSD 2-Clause, BSD 3-Clause or MIT License.