Browse Source
If you're living in a non-UTF-8 character set, then you can configure what quotes are smartly changed. If my regexes are messing things up, you can also turn this off with smart_quotes: false Also updated docs. This closes #50dev
13 changed files with 184 additions and 36 deletions
@ -0,0 +1,3 @@ |
|||||||
|
# If we want to disable smart quoting and only allow explicit quoting within markup, |
||||||
|
# use this option |
||||||
|
smart_quotes: false |
||||||
@ -0,0 +1,15 @@ |
|||||||
|
require 'squib' |
||||||
|
|
||||||
|
Squib::Deck.new(config: 'config_text_markup.yml') do |
||||||
|
text str: %{"'Yaml ain't markup', he says"}, |
||||||
|
x: 10, y: 10, width: 300, height: 200, font: 'Serif 20', |
||||||
|
markup: true, hint: :cyan |
||||||
|
save_png prefix: 'config_text_' |
||||||
|
end |
||||||
|
|
||||||
|
Squib::Deck.new(config: 'config_disable_quotes.yml') do |
||||||
|
text str: %{This has typographic sugar --- and ``explicit'' quotes --- but the quotes are "dumb"}, |
||||||
|
x: 10, y: 10, width: 300, height: 200, font: 'Serif 20', |
||||||
|
markup: true, hint: :cyan |
||||||
|
save_png prefix: 'config_disable_text_' |
||||||
|
end |
||||||
@ -0,0 +1,8 @@ |
|||||||
|
# We can configure what characters actually get replaced by quoting them with unicode code points. |
||||||
|
lsquote: "\u2018" #note that Yaml wants double quotes here to use escape chars |
||||||
|
rsquote: "\u2019" |
||||||
|
ldquote: "\u201C" |
||||||
|
rdquote: "\u201D" |
||||||
|
em_dash: "\u2014" |
||||||
|
en_dash: "\u2013" |
||||||
|
ellipsis: "\u2026" |
||||||
@ -0,0 +1,52 @@ |
|||||||
|
cairo: antialias=(["subpixel"]) |
||||||
|
cairo: save([]) |
||||||
|
cairo: set_source_color([:black]) |
||||||
|
cairo: translate([10, 10]) |
||||||
|
cairo: rotate([0]) |
||||||
|
cairo: move_to([0, 0]) |
||||||
|
pango: font_description=([MockDouble]) |
||||||
|
pango: text=(["\"'Yaml ain't markup', he says\""]) |
||||||
|
pango: markup=(["foo"]) |
||||||
|
pango: width=([307200]) |
||||||
|
pango: height=([204800]) |
||||||
|
pango: wrap=([#<Pango::Layout::WrapMode word-char>]) |
||||||
|
pango: ellipsize=([#<Pango::Layout::EllipsizeMode end>]) |
||||||
|
pango: alignment=([#<Pango::Layout::Alignment left>]) |
||||||
|
pango: justify=([false]) |
||||||
|
pango: spacing=([0]) |
||||||
|
cairo: update_pango_layout([MockDouble]) |
||||||
|
cairo: move_to([0, 0]) |
||||||
|
cairo: update_pango_layout([MockDouble]) |
||||||
|
cairo: show_pango_layout([MockDouble]) |
||||||
|
cairo: rounded_rectangle([0, 0, 0, 0, 0, 0]) |
||||||
|
cairo: set_source_color([:cyan]) |
||||||
|
cairo: set_line_width([2.0]) |
||||||
|
cairo: stroke([]) |
||||||
|
cairo: restore([]) |
||||||
|
surface: write_to_png(["_output/config_text_00.png"]) |
||||||
|
cairo: antialias=(["subpixel"]) |
||||||
|
cairo: save([]) |
||||||
|
cairo: set_source_color([:black]) |
||||||
|
cairo: translate([10, 10]) |
||||||
|
cairo: rotate([0]) |
||||||
|
cairo: move_to([0, 0]) |
||||||
|
pango: font_description=([MockDouble]) |
||||||
|
pango: text=(["This has typographic sugar --- and ``explicit'' quotes --- but the quotes are \"dumb\""]) |
||||||
|
pango: markup=(["foo"]) |
||||||
|
pango: width=([307200]) |
||||||
|
pango: height=([204800]) |
||||||
|
pango: wrap=([#<Pango::Layout::WrapMode word-char>]) |
||||||
|
pango: ellipsize=([#<Pango::Layout::EllipsizeMode end>]) |
||||||
|
pango: alignment=([#<Pango::Layout::Alignment left>]) |
||||||
|
pango: justify=([false]) |
||||||
|
pango: spacing=([0]) |
||||||
|
cairo: update_pango_layout([MockDouble]) |
||||||
|
cairo: move_to([0, 0]) |
||||||
|
cairo: update_pango_layout([MockDouble]) |
||||||
|
cairo: show_pango_layout([MockDouble]) |
||||||
|
cairo: rounded_rectangle([0, 0, 0, 0, 0, 0]) |
||||||
|
cairo: set_source_color([:cyan]) |
||||||
|
cairo: set_line_width([2.0]) |
||||||
|
cairo: stroke([]) |
||||||
|
cairo: restore([]) |
||||||
|
surface: write_to_png(["_output/config_disable_text_00.png"]) |
||||||
Loading…
Reference in new issue