Skip to content

Commit

Permalink
Added tracking adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
royfrancis committed Jan 10, 2025
1 parent 8354a46 commit c2aac17
Show file tree
Hide file tree
Showing 12 changed files with 72 additions and 42 deletions.
4 changes: 4 additions & 0 deletions _extensions/door-sign-five/typst-show.typ
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
gap-below-profile: $gap-below-profile$,
$endif$

$if(tracking)$
tracking: $tracking$,
$endif$

// person info 1
$if(person-1.name)$
person-1-name: "$person-1.name$",
Expand Down
22 changes: 11 additions & 11 deletions _extensions/door-sign-five/typst-template.typ
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
gap-above-profile: 2cm,
gap-below-profile: 0.6cm,
font-size: 16pt,
par-leading: 0.6em,
tracking: 0pt,

person-1-name: none,
person-1-content: none,
Expand Down Expand Up @@ -95,10 +95,10 @@
spacing: 1em,

// name
text(size: 1.4em, tracking: 1pt, weight: 600, person-1-name),
text(size: 1.4em, tracking: tracking, weight: 600, person-1-name),

// content
text(size: 1em, tracking: 0.5pt, person-1-content)
text(size: 1em, tracking: tracking, person-1-content)
)
)
),
Expand Down Expand Up @@ -137,10 +137,10 @@
spacing: 1em,

// name
text(size: 1.4em, tracking: 1pt, weight: 600, person-2-name),
text(size: 1.4em, tracking: tracking, weight: 600, person-2-name),

// content
text(size: 1em, tracking: 0.5pt, person-2-content)
text(size: 1em, tracking: tracking, person-2-content)
)
)
),
Expand Down Expand Up @@ -180,10 +180,10 @@
spacing: 1em,

// name
text(size: 1.4em, tracking: 1pt, weight: 600, person-3-name),
text(size: 1.4em, tracking: tracking, weight: 600, person-3-name),

// content
text(size: 1em, tracking: 0.5pt, person-3-content)
text(size: 1em, tracking: tracking, person-3-content)
)
)
),
Expand Down Expand Up @@ -223,10 +223,10 @@
spacing: 1em,

// name
text(size: 1.4em, tracking: 1pt, weight: 600, person-4-name),
text(size: 1.4em, tracking: tracking, weight: 600, person-4-name),

// content
text(size: 1em, tracking: 0.5pt, person-4-content)
text(size: 1em, tracking: tracking, person-4-content)
)
)
),
Expand Down Expand Up @@ -266,10 +266,10 @@
spacing: 1em,

// name
text(size: 1.4em, tracking: 1pt, weight: 600, person-5-name),
text(size: 1.4em, tracking: tracking, weight: 600, person-5-name),

// content
text(size: 1em, tracking: 0.5pt, person-5-content)
text(size: 1em, tracking: tracking, person-5-content)
)
)
)
Expand Down
4 changes: 4 additions & 0 deletions _extensions/door-sign-four/typst-show.typ
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
$if(gap-below-profile)$
gap-below-profile: $gap-below-profile$,
$endif$

$if(tracking)$
tracking: $tracking$,
$endif$

// person info 1
$if(person-1.name)$
Expand Down
18 changes: 9 additions & 9 deletions _extensions/door-sign-four/typst-template.typ
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
gap-above-profile: 2cm,
gap-below-profile: 0.6cm,
font-size: 16pt,
par-leading: 0.6em,
tracking: 0pt,

person-1-name: none,
person-1-content: none,
Expand Down Expand Up @@ -91,10 +91,10 @@
spacing: 1em,

// name
text(size: 1.4em, tracking: 1pt, weight: 600, person-1-name),
text(size: 1.4em, tracking: tracking, weight: 600, person-1-name),

// content
text(size: 1em, tracking: 0.5pt, person-1-content)
text(size: 1em, tracking: tracking, person-1-content)
))
),

Expand Down Expand Up @@ -132,10 +132,10 @@
spacing: 1em,

// name
text(size: 1.4em, tracking: 1pt, weight: 600, person-2-name),
text(size: 1.4em, tracking: tracking, weight: 600, person-2-name),

// content
text(size: 1em, tracking: 0.5pt, person-2-content)
text(size: 1em, tracking: tracking, person-2-content)
)
)
),
Expand Down Expand Up @@ -175,10 +175,10 @@
spacing: 1em,

// name
text(size: 1.4em, tracking: 1pt, weight: 600, person-3-name),
text(size: 1.4em, tracking: tracking, weight: 600, person-3-name),

// content
text(size: 1em, tracking: 0.5pt, person-3-content)
text(size: 1em, tracking: tracking, person-3-content)
)
)
),
Expand Down Expand Up @@ -218,10 +218,10 @@
spacing: 1em,

// name
text(size: 1.4em, tracking: 1pt, weight: 600, person-4-name),
text(size: 1.4em, tracking: tracking, weight: 600, person-4-name),

// content
text(size: 1em, tracking: 0.5pt, person-4-content)
text(size: 1em, tracking: tracking, person-4-content)
)
)
)
Expand Down
4 changes: 4 additions & 0 deletions _extensions/door-sign-one/typst-show.typ
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
gap-below-profile: $gap-below-profile$,
$endif$

$if(tracking)$
tracking: $tracking$,
$endif$

// person info
$if(person-1.name)$
person-1-name: "$person-1.name$",
Expand Down
7 changes: 3 additions & 4 deletions _extensions/door-sign-one/typst-template.typ
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
gap-above-profile: 2cm,
gap-below-profile: 0.6cm,
font-size: 16pt,
par-leading: 0.6em,
tracking: 0pt,

person-1-name: none,
person-1-content: none,
Expand All @@ -27,7 +27,6 @@

// body font.
set text(font-size, font: "Lato", fill: rgb("#444444"))
// set par(leading: par-leading)
// set block(spacing: 1.4em)

// set document(title: title)
Expand Down Expand Up @@ -80,10 +79,10 @@
}),

// name
text(size: 1.4em, tracking: 1pt, weight: 600, person-1-name),
text(size: 1.4em, tracking: tracking, weight: 600, person-1-name),

// content
text(size: 1em, tracking: 0.5pt, person-1-content)
text(size: 1em, tracking: tracking, person-1-content)
)
)

Expand Down
4 changes: 4 additions & 0 deletions _extensions/door-sign-three/typst-show.typ
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
gap-below-profile: $gap-below-profile$,
$endif$

$if(tracking)$
tracking: $tracking$,
$endif$

// person info 1
$if(person-1.name)$
person-1-name: "$person-1.name$",
Expand Down
14 changes: 7 additions & 7 deletions _extensions/door-sign-three/typst-template.typ
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
gap-above-profile: 2cm,
gap-below-profile: 0.6cm,
font-size: 16pt,
par-leading: 0.6em,
tracking: 0pt,

person-1-name: none,
person-1-content: none,
Expand Down Expand Up @@ -87,10 +87,10 @@
spacing: 1em,

// name
text(size: 1.4em, tracking: 1pt, weight: 600, person-1-name),
text(size: 1.4em, tracking: tracking, weight: 600, person-1-name),

// content
text(size: 1em, tracking: 0.5pt, person-1-content)
text(size: 1em, tracking: tracking, person-1-content)
))
),

Expand Down Expand Up @@ -128,10 +128,10 @@
spacing: 1em,

// name
text(size: 1.4em, tracking: 1pt, weight: 600, person-2-name),
text(size: 1.4em, tracking: tracking, weight: 600, person-2-name),

// content
text(size: 1em, tracking: 0.5pt, person-2-content)
text(size: 1em, tracking: tracking, person-2-content)
)
)
),
Expand Down Expand Up @@ -171,10 +171,10 @@
spacing: 1em,

// name
text(size: 1.4em, tracking: 1pt, weight: 600, person-3-name),
text(size: 1.4em, tracking: tracking, weight: 600, person-3-name),

// content
text(size: 1em, tracking: 0.5pt, person-3-content)
text(size: 1em, tracking: tracking, person-3-content)
)
)
)
Expand Down
4 changes: 4 additions & 0 deletions _extensions/door-sign-two/typst-show.typ
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
gap-below-profile: $gap-below-profile$,
$endif$

$if(tracking)$
tracking: $tracking$,
$endif$

// person info 1
$if(person-1.name)$
person-1-name: "$person-1.name$",
Expand Down
10 changes: 5 additions & 5 deletions _extensions/door-sign-two/typst-template.typ
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
gap-above-profile: 2cm,
gap-below-profile: 0.6cm,
font-size: 16pt,
par-leading: 0.6em,
tracking: 0pt,

person-1-name: none,
person-1-content: none,
Expand Down Expand Up @@ -81,10 +81,10 @@
}),

// name
text(size: 1.4em, tracking: 1pt, weight: 600, person-1-name),
text(size: 1.4em, tracking: tracking, weight: 600, person-1-name),

// content
text(size: 1em, tracking: 0.5pt, person-1-content)
text(size: 1em, tracking: tracking, person-1-content)
),

stack(
Expand Down Expand Up @@ -116,10 +116,10 @@
}),

// name
text(size: 1.4em, tracking: 1pt, weight: 600, person-2-name),
text(size: 1.4em, tracking: tracking, weight: 600, person-2-name),

// content
text(size: 1em, tracking: 0.5pt, person-2-content)
text(size: 1em, tracking: tracking, person-2-content)
)
)
)
Expand Down
21 changes: 16 additions & 5 deletions app.r
Original file line number Diff line number Diff line change
Expand Up @@ -40,28 +40,33 @@ ui <- page_fluid(
layout_columns(
tooltip(
numericInput("in_height", "Image height", min = 1, max = 10, step = 0.5, value = 6),
"Height of profile image. Value between 1 and 10.",
"Height of profile image. Value between 1 and 10 cm.",
placement = "right"
),
tooltip(
numericInput("in_size", "Font size", min = 5, max = 20, step = 1, value = 16),
"Base font size. Value between 5 and 20.",
"Base font size. Value between 5 and 20 pt.",
placement = "right"
),
col_width = c(6, 6)
),
layout_columns(
tooltip(
numericInput("in_gap_above", "Upper gap", min = 0, max = 3, step = 0.1, value = 2),
"Value between 0 and 3.",
"Value between 0 and 3 cm.",
placement = "right"
),
tooltip(
numericInput("in_gap_below", "Lower gap", min = 0, max = 3, step = 0.1, value = 0.6),
"Value between 0 and 3.",
"Value between 0 and 3 cm.",
placement = "right"
),
col_width = c(6, 6)
),
tooltip(
sliderInput("in_tracking", "Tracking", min = 0, max = 0.2, step = 0.01, value = 0.02),
"Character spacing. Value between 0 and 0.2 pt.",
placement = "right"
)
)
)
Expand All @@ -82,7 +87,7 @@ ui <- page_fluid(
div(
class = "help-note",
paste0(format(Sys.time(), "%Y"), " Roy Francis • Version: ", fn_version()),
HTML("• <a href='https://github.com/royfrancis/shiny-doorsign' target='_blank'><i class='fab fa-github'></i></a> <a href='mailto:roy.francis@nbis.se' target='_blank'><i class='fa fa-envelope'></i></a>")
HTML("• <a href='https://github.com/royfrancis/shiny-doorsign' target='_blank'><i class='fab fa-github'></i></a> <U+2022> <a href='mailto:roy.francis@nbis.se' target='_blank'><i class='fa fa-envelope'></i></a>")
)
)
)
Expand Down Expand Up @@ -193,6 +198,11 @@ server <- function(input, output, session) {
input$in_gap_below
}), "cm")

l["tracking"] <- paste0(ifelse(is.null(input$in_tracking), 0.4, {
validate(fn_validate_range(input$in_tracking, -1.0, 1.0, label = "Tracking"))
input$in_tracking
}), "em")

l["persons"] <- tracks

return(l)
Expand Down Expand Up @@ -307,6 +317,7 @@ server <- function(input, output, session) {

observeEvent(input$btn_reset, {
updateSliderInput(session, "in_tracks", "Number of persons", min = 1, max = 5, value = 1, step = 1)
updateSliderInput(session, "in_tracking", "Tracking", min = 0, max = 0.2, step = 0.01, value = 0.02)
})

## OSE -----------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion functions.r
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fn_dir <- function(session) {

# fn_version
fn_version <- function() {
return("v2.1.2")
return("v2.1.3")
}

# validation
Expand Down

0 comments on commit c2aac17

Please sign in to comment.