Copyright © 2018 Lloyd R. Prentice
Version: .01
Authors: Lloyd R. Prentice.
License: MIT File: ep_box.erl Description:
Boxes "contain" content elements--- text, images, and PDF elements.
Boxes are composed on "page grids" to organize content and direct "eye path."
All box functions assume that the top left coordinate is at X, Y and Y coordinates increment downward. This conceit makes it easier to layout page grids, since we read pages top down rather than bottom up.
PDF, on the other hand, assumes that X, Y is at the bottom of the box and Y increments upward. Thus, when rendered by PDF, Y coordinate must be flipped; e.g. X, Y at the bottom left of the box and Y incrementing upward.
Y coordinates can be flipped with the function ep_lib:v_flip/2 which takes the vertical dimension of the paper stock on which the box will be printed as a parameter; e.g. when flipped, the top of the box will be relative to the top of the paper stock.
{X, Y} = position of box where X = upper left X coordinate of box in points Y = upper left Y coordinate of box in points Measure | Width = width of box in points Height = height of box in pntsep_box() = #{id => string(), x => points(), y => points(), width => points(), height => points(), gutter => points(), leading => points(), filled => integer(), y_ptr => points(), available => points(), bg_flag => boolean(), border => points(), border_type => atom(), border_color => color(), text_margin => points(), text_color => color(), background_color => color(), stroke => stroke(), stroke_color => color(), fill_color => color(), indent => points(), continue => term()}
| available/1 | Return space available for content. |
| available_lines/2 | |
| background/1 | Return panel background parameters. |
| background_color/1 | Return background color; white, silver, gray, black, maroon, red, fuchsia, purple lime, green, olive, yellow, navy, blue, teal, aqua. |
| bg_flag/1 | Return state of background flag; if true, print background. |
| border/1 | Return width of border. |
| border_color/1 | Return border color; white, silver, gray, black, maroon, red, fuchsia, purple lime, green, olive, yellow, navy, blue, teal, aqua. |
| border_type/1 | Return border type; solid, dashed, beveled. |
| box_spec/1 | Return position and dimensions of box. |
| clip/3 | Clip box top, right, bottom, or left. |
| continue/1 | Return text overflow rule. |
| corners/1 | return corner coordiates of box. |
| create/4 | Create a new box; all parameters in points. |
| default_gutter/0 | Return default gutter width of box; e.g. |
| default_leading/0 | Return default leading under box; e.g. |
| dimensions/1 | Return width and height of box. |
| end_x/1 | Return right edge of box. |
| end_y/1 | Return bottom edge of box. |
| fill_color/1 | Return fill color; white, silver, gray, black, maroon, red, fuchsia, purple lime, green, olive, yellow, navy, blue, teal, aqua. |
| filled/1 | Return vertical space at top of box occupied by content. |
| gutter/1 | Return gutter width of box; e.g. |
| height/1 | Return height of box. |
| here/1 | Return position and dimensions of box. |
| hide_border/1 | Clear border flag. |
| id/1 | Return id of box. |
| if_background/1 | Alias for bg_blg/1. |
| if_border/1 | Return true if box configured to show border and background. |
| indent/1 | Return text indent. |
| inner_box/1 | Return position and dimensions of text area in panel. |
| leading/1 | Return leading under box; e.g. |
| max_lines/2 | max_2 and n_lines/2 get leading from TypeSpec See: ep_typespec:new/3. |
| measure/1 | Type setter speak; alias of width;. |
| n_lines/2 | max_2 and n_lines/2 get leading from TypeSpec See: ep_typespec:new/3. |
| outer_box/1 | Return position and dimensions ofBox. |
| position/1 | Return upper-left xy coordinates of box. |
| reset_bg_flag/1 | |
| set_bg_flag/1 | |
| shift/3 | Shift box up, down, right, or left. |
| show_border/1 | Set border flag. |
| stroke/1 | return stroke type; close, stroke, close_stroke, fill, fill_even_odd, fill_stroke, fill_then_stroke, fill_stroke_even_odd, close_fill_stroke, close_fill_stroke_even_odd, endpath SEE eg_pdf_op:path/1. |
| stroke_color/1 | Return stroke color; white, silver, gray, black, maroon, red, fuchsia, purple lime, green, olive, yellow, navy, blue, teal, aqua. |
| text_box/1 | return text box dimensions. |
| text_color/1 | Return text color; white, silver, gray, black, maroon, red, fuchsia, purple lime, green, olive, yellow, navy, blue, teal, aqua. |
| text_margin/1 | Return order. |
| total_height/1 | Return height + leading in points. |
| total_width/1 | Return width + gutter in points. |
| update_available/2 | |
| update_background_color/2 | Update background color; white, silver, gray, black, maroon, red, fuchsia, purple lime, green, olive, yellow, navy, blue, teal, aqua. |
| update_border/2 | Update width of border (points). |
| update_border_color/2 | Update border color; white, silver, gray, black, maroon, red, fuchsia, purple lime, green, olive, yellow, navy, blue, teal, aqua. |
| update_border_type/2 | Update border type:. |
| update_continue/2 | Update text overflow rule. |
| update_fill_color/2 | Update fill color; white, silver, gray, black, maroon, red, fuchsia, purple lime, green, olive, yellow, navy, blue, teal, aqua. |
| update_filled/2 | Update filled. |
| update_gutter/2 | Update gutter; e.g. |
| update_height/2 | Update height (points). |
| update_id/2 | Update id. |
| update_indent/2 | Update text indent (points). |
| update_leading/2 | Update leading; e.g. |
| update_margin/2 | |
| update_stroke/2 | Update stroke type; close, stroke, close_stroke, fill, fill_even_odd, fill_stroke, fill_then_stroke, fill_stroke_even_odd, close_fill_stroke, close_fill_stroke_even_odd, endpath SEE eg_pdf_op:path/1. |
| update_stroke_color/2 | Update stroke color; white, silver, gray, black, maroon, red, fuchsia, purple lime, green, olive, yellow, navy, blue, teal, aqua. |
| update_text_color/2 | Update text color; white, silver, gray, black, maroon, red, fuchsia, purple lime, green, olive, yellow, navy, blue, teal, aqua. |
| update_text_margin/2 | Update text margine; e.g.space between border and text (points). |
| update_width/2 | Update width (points). |
| update_x/2 | Update horizontal position; e.g. |
| update_y/2 | Update vertical position; e.g. |
| update_y_ptr/2 | Update pointer to y position of next content. |
| v_flip_box/2 | |
| width/1 | Return width of box. |
| will_fit/3 | Given leading, returns true if lines will fit in box. |
| x/1 | Return X coordinate of upper left corner of box. |
| y/1 | Return Y coordinate of upper left corner of box. |
| y_ptr/1 | Return y position for new content. |
available(Box::ep_box()) -> term()
Return space available for content
Return panel background parameters
background_color(Box::ep_box()) -> atom()
Return background color; white, silver, gray, black, maroon, red, fuchsia, purple lime, green, olive, yellow, navy, blue, teal, aqua
bg_flag(Box::ep_box()) -> boolean()
Return state of background flag; if true, print background
border(Box::ep_box()) -> integer()
Return width of border
border_color(Box::ep_box()) -> atom()
Return border color; white, silver, gray, black, maroon, red, fuchsia, purple lime, green, olive, yellow, navy, blue, teal, aqua
border_type(Box::ep_box()) -> atom()
Return border type; solid, dashed, beveled
Return position and dimensions of box
Clip box top, right, bottom, or left
continue(X1) -> any()
Return text overflow rule
return corner coordiates of box
Create a new box; all parameters in points
default_gutter() -> points()
Return default gutter width of box; e.g. margin outside right edge
default_leading() -> points()
Return default leading under box; e.g. margin below bottom edge
Return width and height of box
Return right edge of box
Return bottom edge of box
Return fill color; white, silver, gray, black, maroon, red, fuchsia, purple lime, green, olive, yellow, navy, blue, teal, aqua
filled(Box::ep_box()) -> term()
Return vertical space at top of box occupied by content
Return gutter width of box; e.g. margin outside right edge
Return height of box
Return position and dimensions of box
Clear border flag
id(Box::ep_box()) -> string()
Return id of box
if_background(Box) -> any()
Alias for bg_blg/1
if_border(Box::ep_box()) -> boolean()
Return true if box configured to show border and background
indent(Box::ep_box()) -> integer()
Return text indent
Return position and dimensions of text area in panel
Return leading under box; e.g. margin below bottom edge
max_lines(Box, TypeSpec) -> any()
max_2 and n_lines/2 get leading from TypeSpec See: ep_typespec:new/3
Type setter speak; alias of width;
n_lines(Box, TypeSpec) -> any()
max_2 and n_lines/2 get leading from TypeSpec See: ep_typespec:new/3
Return position and dimensions ofBox
Return upper-left xy coordinates of box
shift(Box::ep_box(), X2::direction(), N::integer()) -> ep_box()
Shift box up, down, right, or left
Set border flag
return stroke type; close, stroke, close_stroke, fill, fill_even_odd, fill_stroke, fill_then_stroke, fill_stroke_even_odd, close_fill_stroke, close_fill_stroke_even_odd, endpath SEE eg_pdf_op:path/1
Return stroke color; white, silver, gray, black, maroon, red, fuchsia, purple lime, green, olive, yellow, navy, blue, teal, aqua
return text box dimensions
text_color(Box::ep_box()) -> atom()
Return text color; white, silver, gray, black, maroon, red, fuchsia, purple lime, green, olive, yellow, navy, blue, teal, aqua
text_margin(Box::ep_box()) -> integer()
Return order
Return height + leading in points
Return width + gutter in points
Update background color; white, silver, gray, black, maroon, red, fuchsia, purple lime, green, olive, yellow, navy, blue, teal, aqua
Update width of border (points)
Update border color; white, silver, gray, black, maroon, red, fuchsia, purple lime, green, olive, yellow, navy, blue, teal, aqua
Update border type:
update_continue(Continue, Box) -> any()
Update text overflow rule
Update fill color; white, silver, gray, black, maroon, red, fuchsia, purple lime, green, olive, yellow, navy, blue, teal, aqua
Update filled
Update gutter; e.g. outside right margin (pints)
Update height (points)
Update id
Update text indent (points)
Update leading; e.g. margin below bottom edge (pints)
Update stroke type; close, stroke, close_stroke, fill, fill_even_odd, fill_stroke, fill_then_stroke, fill_stroke_even_odd, close_fill_stroke, close_fill_stroke_even_odd, endpath SEE eg_pdf_op:path/1
Update stroke color; white, silver, gray, black, maroon, red, fuchsia, purple lime, green, olive, yellow, navy, blue, teal, aqua
Update text color; white, silver, gray, black, maroon, red, fuchsia, purple lime, green, olive, yellow, navy, blue, teal, aqua
Update text margine; e.g.space between border and text (points)
Update width (points)
Update horizontal position; e.g. X (points)
Update vertical position; e.g. Y (points)
Update pointer to y position of next content
v_flip_box(Box::ep_box(), PaperStock::paper_stock()) -> ep_box()
Return width of box
Given leading, returns true if lines will fit in box
Return X coordinate of upper left corner of box
Return Y coordinate of upper left corner of box
y_ptr(Box::ep_box()) -> term()
Return y position for new content
Generated by EDoc