Skip to content

Commit

Permalink
change import statements
Browse files Browse the repository at this point in the history
  • Loading branch information
cormullion committed Mar 6, 2022
1 parent 6152891 commit 2e7d758
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 6 deletions.
21 changes: 21 additions & 0 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -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
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Luxor"
uuid = "ae8d54c2-7ccd-5906-9d76-62fc9837b5bc"
authors = ["cormullion <[email protected]>"]
version = "3.1.0"
version = "3.1.1"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Expand Down
13 changes: 9 additions & 4 deletions src/text.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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,)
Expand All @@ -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
Expand Down

0 comments on commit 2e7d758

Please sign in to comment.