diff --git a/.JuliaFormatter.toml b/.JuliaFormatter.toml new file mode 100644 index 00000000..ee2e795f --- /dev/null +++ b/.JuliaFormatter.toml @@ -0,0 +1,21 @@ +align_struct_field = true +always_for_in = true +always_use_return = false +annotate_untyped_fields_with_any = false +join_lines_based_on_source = true +margin=1500 +remove_trailing_comma = true +whitespace_in_kwargs = true +whitespace_ops_in_indices = true +align_assignment = true +align_conditional = true +#align_matrix = false +align_pair_arrow = true +conditional_to_if = true +format_docstrings = true +#import_to_using = false +normalize_line_endings = "auto" +#pipe_to_function_call = false +remove_extra_newlines = true +#short_to_long_function_def = false +#whitespace_typedefs = false diff --git a/CHANGELOG.md b/CHANGELOG.md index df4164c7..084576b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,20 @@ # Changelog -## [v3.1.0] - 2022-02-06 +## [v3.1.1] - 2022-03-06 + +### Added + +### Changed + +- imports in latex.jl + +### Removed + +### Deprecated + +# ──────────────────────────────────────────────────────────────────────────────────── + +## [v3.1.0] - 2022-02-26 ### Added diff --git a/Project.toml b/Project.toml index 607f21cf..868593dd 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Luxor" uuid = "ae8d54c2-7ccd-5906-9d76-62fc9837b5bc" authors = ["cormullion "] -version = "3.1.0" +version = "3.1.1" [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" diff --git a/src/text.jl b/src/text.jl index f4540b1e..b8e1223a 100644 --- a/src/text.jl +++ b/src/text.jl @@ -844,12 +844,16 @@ texttrack(txt, pos, tracking; startnewpath=startnewpath) """ - textplace(txt::AbstractString, pos::Point, params::Vector) + textplace(txt::AbstractString, pos::Point, params::Vector; + action = :fill, + startnewpath = false) A low-level function that places text characters one by one according to the parameters in `params`. First character uses the first tuple, second character uses the second, and -so on. Returns the next text position. +so on. + +Returns the next text position. A tuple of parameters is: @@ -898,7 +902,8 @@ txtpos = textplace("93—4!", O - (200, 0), [ ``` """ function textplace(txt::AbstractString, pos::Point, params::Vector; - action=:fill) + action = :fill, + startnewpath = false) @layer begin textpos = Point(pos.x, pos.y) currentparams = (face = "", size = 12, color = colorant"black", kern=0, shift=0, advance=true,) @@ -912,7 +917,7 @@ function textplace(txt::AbstractString, pos::Point, params::Vector; sethue(currentparams.color) xbearing, ybearing, textwidth, textheight, xadvance, yadvance = textextents(string(c)) temp_text_pos = Point(textpos.x + currentparams.kern, textpos.y - currentparams.shift) - textoutlines(string(c), temp_text_pos, action=action, halign=:left) + textoutlines(string(c), temp_text_pos, action=action, halign=:left, startnewpath = startnewpath) if currentparams.advance == true textpos += (xadvance + currentparams.kern, 0) end