Commit Graph

461 Commits (77a694f797078c002e4f976ee5c447ef5afefd11)

Author SHA1 Message Date
Andy Meneely a8241418c6 docs: readthedocs.org --> .io 2016-05-24 22:17:19 -04:00
Andy Meneely 7b9b836d61 Onward and upward. 2016-05-06 13:11:20 -04:00
Andy Meneely 839fceeeb3 I dub thee v0.10.0 2016-05-06 13:05:07 -04:00
Andy Meneely 56d8cff626 version: bump to beta 2016-04-25 23:43:12 -04:00
Andy Meneely ee0d232478 text: rewrite how image space is carved
Embedded images avoid zero-sized fonts by using non-printable characters instead.

This is for #153 and #103
2016-04-25 23:36:10 -04:00
Andy Meneely 6caf2e1af4 Remove debug code 2016-04-25 23:02:44 -04:00
Andy Meneely 013a1532f2 Fixes #152 2016-04-25 23:01:18 -04:00
Andy Meneely 43d44aa944 samples: gists --> backend 2016-04-11 20:42:48 -04:00
Andy Meneely 795b4e4478 csv: yield to block on each cell
Closes #151

Related to #145
2016-04-11 20:07:55 -04:00
Andy Meneely 39346d53c2 fix method call 2016-04-08 23:50:21 -04:00
Andy Meneely 2329a069d1 save_pdf: flush to file
Fixes #150
2016-03-29 13:37:13 -04:00
Andy Meneely d7943da750 csv: allow all Ruby csv parsing options
Closes #149

Generalization on PR #146 by Qgel. Thanks for the contribution!
2016-03-24 02:23:47 -04:00
Andy Meneely 7acb27e477 Merge remote-tracking branch 'origin/master' into dev 2016-03-23 23:22:22 -04:00
Mirko Kugelmeier 5eee51f38b Added 'sep' parameter to csv DSL method to define the column seperator of the file 2016-03-23 15:13:28 +01:00
Andy Meneely d1993eb14f build groups: finish renaming 2016-03-21 19:53:01 -04:00
Andy Meneely e55c450d16 build_groups: rename to build instead of group 2016-03-20 22:52:04 -04:00
Andy Meneely dad2ab5ba9 👮 newline at end of file 2016-03-17 23:51:37 -04:00
Andy Meneely 0cbcc0c683 👮 string literals should be single-quoted 2016-03-17 23:49:04 -04:00
Andy Meneely 65a0fdfd47 👮 leading space in comments 2016-03-17 23:47:32 -04:00
Andy Meneely 0f5b7d0f8e 👮 space inside parens 2016-03-17 23:42:09 -04:00
Andy Meneely 310030eee4 👮 spaces around operators 2016-03-17 23:40:41 -04:00
Andy Meneely 5e09e0f1e1 👮 fix spacing inside hashes 2016-03-17 23:38:48 -04:00
Andy Meneely 137e3f91cd 👮 fix extra spaces 2016-03-17 23:27:07 -04:00
Andy Meneely 8a9552126c 👮 fix space after comma 2016-03-17 23:22:16 -04:00
Andy Meneely 8eb7bc9547 docs: rip out old YARD comments 👍 2016-03-17 13:49:33 -04:00
Andy Meneely 955d64a01f feature: add use_layout method to load layouts at runtime
Closes #141
2016-03-16 17:05:07 -04:00
Andy Meneely 9cdd3c4d2f text: fix valign when we only have an embed key
Fixes #134
2016-03-15 23:07:23 -04:00
Andy Meneely f408b7a88f csv: data option
Close #137
2016-03-15 17:45:39 -04:00
Andy Meneely 61a3d3446b feature: build groups
See docs and changelog for more details on how these work.
2016-03-13 00:38:13 -05:00
Andy Meneely ec767110a6 docs: port data import methods to readthedocs 2016-01-29 21:26:51 -05:00
Andy Meneely cbe013323d Switch to require_relative
Helps with debugging code without reloading the entire gem

Fixes #130
2016-01-28 21:11:14 -05:00
Andy Meneely 97fa07382d Onward and upward 2016-01-10 21:00:04 -05:00
Andy Meneely 96c4944ffe I dub thee v0.9 2016-01-10 20:50:10 -05:00
Andy Meneely cf736db067 Maintain coordinate system when using gradients
Sample: document this better
spec: test this and update past tests

Fixes #127
2016-01-10 20:30:30 -05:00
Andy Meneely 38266eb4c1 Samples: less harsh blue on graph paper lines 2015-12-21 10:46:05 -05:00
Andy Meneely 4c16930b1f Bump to beta test
Starting with this version, I'm gonna kick this out to my beta testers to look for regressions or issues.
2015-12-12 00:05:59 -05:00
Andy Meneely 8b0067546f save_png: add trim and trim_radius options
Close #122.
2015-12-11 23:09:04 -05:00
Andy Meneely 1c982ec824 squib new: Templates IDEAS, PLAYTESTING, RULES 2015-11-26 23:41:41 -05:00
Andy Meneely 1c095f2b19 Samples: add helper methods for graph paper look-and-feel 2015-11-23 23:10:35 -05:00
Andy Meneely 710d28f5a8 Add warning to suppress png scaling warning
Close #120
2015-11-02 21:07:14 -05:00
Andy Meneely a57c2a7dad Make grid option 0.25in spacing by default 2015-10-27 00:02:15 -04:00
Andy Meneely b00cc99dd0 Added a grid shape
Close #68
2015-10-26 23:59:51 -04:00
Andy Meneely d99e840ffd PNG/SVG: flipping is now supported.
Fixes #11
2015-10-26 23:31:16 -04:00
Andy Meneely 169f9e4ac4 SVGs: now with more cropping power!
Contributes to #11
2015-10-26 22:47:42 -04:00
Andy Meneely 541c8d49ca Crop PNGs, now with more rounded corners!
Contributes to #11
2015-10-26 22:35:56 -04:00
Andy Meneely 7126afbc9c Warn on conf when an option is not recognized 2015-10-26 16:14:13 -04:00
Andy Meneely 47b5f569a4 Rip out old constants from pre args classes 2015-10-26 15:32:04 -04:00
Andy Meneely a82664d223 Onward and upward. 2015-10-26 14:59:50 -04:00
Andy Meneely f39dda26d5 I dub thee v0.8 2015-10-26 14:51:49 -04:00
Andy Meneely 08381b86f0 Add quantity explosion to xlsx and csv
Closes #78
2015-10-20 18:23:25 -04:00
AlexGorski 69be9e8526 layout file for TheGameCrafter tuck boxes 2015-10-17 17:45:40 -04:00
Andy Meneely e8d7480a63 Range option shouldn't fail on []
Fixes #107
2015-10-13 15:01:14 -04:00
Andy Meneely c976772b9e Being even more Ruby 2.1-friendly 2015-10-13 14:02:22 -04:00
Andy Meneely 4be222a915 Being more Ruby 2.1-friendly 2015-10-13 13:59:37 -04:00
Andy Meneely c8e6f9803c xlsx,csv: trim whitespace, yield to optional block
Closes #108 and #79
2015-10-13 10:37:49 -04:00
Andy Meneely b136529ed7 Onward and upward 2015-09-11 11:08:53 -04:00
Andy Meneely 3a6ab0cf37 I dub thee v0.7 2015-09-11 10:45:24 -04:00
Andy Meneely 0fe5c55b9e Embedded icons respect img_dir 2015-09-07 22:43:07 -04:00
Andy Meneely c6767d10b6 Use summary from save_batch.rb 2015-08-18 22:40:28 -04:00
Andy Meneely 19e38d798f Require yaml just in case 2015-08-18 22:34:50 -04:00
Andy Meneely 5042ee8edc Ripping out the notorious input_helpers.rb 2015-08-15 14:59:08 -04:00
Andy Meneely 2dfaf64ef7 Convert data reading methods to args classes 2015-08-15 14:44:27 -04:00
Andy Meneely 82a2538180 Removing dependency on ill-fated input_helpers.rb 2015-08-15 00:32:44 -04:00
Andy Meneely 4d1661ac0b Convert hand method to args classes 2015-08-15 00:17:29 -04:00
Andy Meneely 697a51d8e5 Cleanup dead code 2015-08-15 00:01:11 -04:00
Andy Meneely 3f2b057466 Convert save_sheet and save_pdf to args classes 2015-08-14 23:56:03 -04:00
Andy Meneely bcc6d355d2 Convert showcase to args classes 2015-08-14 21:08:11 -04:00
Andy Meneely f8a18cdbce Finished porting of save_png over to args classes 2015-08-12 23:41:15 -04:00
Andy Meneely 4aee48dada Working on save args 2015-08-12 15:57:58 -04:00
Andy Meneely af53e396dc Refactoring: remove semicolons 2015-08-12 15:22:01 -04:00
Andy Meneely a7962e3728 Start porting save methods over to args 2015-08-09 23:25:38 -04:00
Andy Meneely 3e2418d82d Add in require 2015-08-09 22:57:24 -04:00
Andy Meneely 354a97f100 Add validation to text embed key 2015-08-09 22:15:10 -04:00
Andy Meneely fed2889aef text: Reset move_to for valign if doing a stroke outline
Contributes to #102

[skip ci]
2015-07-27 23:22:22 -04:00
Andy Meneely 19767c54c4 Implement stroke_strategy option for all drawing operations
Fixes #102
2015-07-27 22:55:49 -04:00
Andy Meneely e03a97ce7e Add :scale shortcut to width/height of png and svg
Allows scaling while keeping the aspect ratio

Closes #91
2015-07-27 13:25:12 -04:00
Andy Meneely 7c756e468d Remove dead code 2015-07-26 23:34:02 -04:00
Andy Meneely 9d475995e8 Pango scaling of "spacing" in text is done once
Spacing also defaults to nil, not zero, as before

Fixes #98
2015-07-26 22:26:42 -04:00
Andy Meneely 54185fe9eb Warn on non-existing layout
Fix #99 and refactor args_loader a bit
2015-07-26 21:50:43 -04:00
Andy Meneely 003a26ae68 Two new built-in layouts: fantasy.yml and economy.yml
Contributes to #97
2015-07-26 00:59:12 -04:00
Andy Meneely 70a5f48bda Add nil check for colors, just in case
Probably not possible, but provides a more descriptive error than before anyway.

Fixes #84.
2015-07-21 21:37:54 -04:00
Andy Meneely f21e9448e1 Warn when text is ellipsized
Closes #80
2015-07-21 21:31:50 -04:00
Andy Meneely 92d866548c Cleanup of img_dir and testing of input_file.rb 2015-07-21 21:04:23 -04:00
Andy Meneely 813b8f8600 Fix documentation on svg method 2015-07-21 20:47:09 -04:00
Andy Meneely 04ac3f730a Fix mock object tests 2015-07-21 20:44:08 -04:00
Andy Meneely e20c644a9a Implemented new args design for svg and png
As part of that implementation, text_embed now supports singleton expansion. Closes #54
2015-07-21 20:27:15 -04:00
Andy Meneely 25b13fd592 Better ability to handle per-dsl-method defaults 2015-07-12 00:52:34 -04:00
Andy Meneely f2d693f8ff Updated debugging for new args classes 2015-07-12 00:51:57 -04:00
Andy Meneely 3783640889 Strip trailing and leading whitespace on text args 2015-07-12 00:35:50 -04:00
Andy Meneely 08d0ac2b60 Starting paint args class - not integrated yet.
Draw args also now requires custom_colors from Deck. (Can't trust caller to override the default.)
2015-07-12 00:06:27 -04:00
Andy Meneely c66c6bc4f0 Removed img_dir from set method, added specs 2015-07-10 12:43:56 -04:00
Melody 4bc8ba7455 fixes #56 by accounting for case that would produce zero rows 2015-07-08 22:28:36 -04:00
Andy Meneely e43f68d323 Ported text command over to the new args classes
* Involved a big rewrite of arg_loader to accomodate nil and false better. Sadly this meant dumping ||= for if-statements. Blech, but works.
  * Updates to regression tests are pretty trivial.
  * Removed graphics_text_spec because, even though it looks useful, with rake sanity it really isn't.
  * Exposed font on deck as well

Cleaned up graphics/text.rb too!
2015-07-07 23:59:23 -04:00
Andy Meneely 1b22542655 Remove dead code 2015-07-03 16:06:00 -04:00
Andy Meneely 79814a43ea Start migrating text over to new args system
Almost there. It's working fine with the sample, but next it's time to write validators to get all this arg logic out of text.rb and make it just about drawing text.

Yes, unit tests aren't updated yet.
[skip ci]
2015-07-03 02:11:32 -04:00
Andy Meneely 6aecdbbb4a Adding custom colors to the draw arg 2015-07-03 00:47:46 -04:00
Andy Meneely c931a860a1 Args refactoring: combine polygon, tri, and bezier args into coords
As a rule, I think it's better to group args classes together have some extra overhead of extracting unused parameters. For example, we don't *need* to extract "n" for the circle, but the ease of having logically grouped classes is better than having tons of different classes tailored to each command.
2015-06-16 21:14:43 -04:00
Andy Meneely b5903293d7 Layouts use strings as keys, so that must be realistic 2015-06-11 17:20:02 -04:00
Andy Meneely 243b3836c4 Refactor to remove instance_eval
When you have a hammer...
2015-06-11 17:19:17 -04:00
Andy Meneely c5e00f1877 Employing the new args refactoring on all shapes 2015-06-11 16:16:08 -04:00
Andy Meneely 8a7841d64f Add dash option to drawing operations
Currently only impacts rect, but it will impact others with the new design shortly
2015-06-08 15:26:33 -04:00
Andy Meneely 12c5cd675b Added line cap and join settings for rect and curve
More forthcoming - these are proof-of-concept
2015-06-08 14:17:46 -04:00
Andy Meneely c1e410fe72 First foray into args class refactoring: rect
So far, I really like this approach. It allows us to push validation logic out of the Card class and into its own set of classes that can be more easily tested.

Fixes #75, but we've got a lot more work to do in getting this full scale
2015-06-08 13:36:23 -04:00
Andy Meneely 6c60f21bb0 Refactored drawing to get fill_n_stroke
Contributes to #75
2015-06-04 16:40:55 -04:00
Andy Meneely da0fe1b118 Onward and upward. 2015-05-26 21:04:15 -04:00
Andy Meneely 981a9eab0e I dub thee v0.6.0 2015-05-26 20:57:58 -04:00
Andy Meneely a20100f3f8 Hiding private stuff from public documentation 2015-05-26 20:55:11 -04:00
Andy Meneely 3bbc787025 Add polygon method to dsl
Testing and documentation too.

Closes #67
2015-05-22 06:12:48 -04:00
Andy Meneely f0b71531aa Allowing close_path to pass through 2015-05-22 05:59:08 -04:00
Andy Meneely c3e76a93aa Fix a syntax error 2015-05-22 05:36:32 -04:00
Andy Meneely 6d8e44920b Allow unit conversion on radius for star 2015-05-22 05:32:27 -04:00
Andy Meneely 6cf6ec8099 Fix documentation for shapes 2015-05-22 05:32:03 -04:00
Andy Meneely 0853b6a708 Finish regression testing of star 2015-05-21 18:29:38 -04:00
Andy Meneely 4b63716dfc Star feature works, testing is still pending 2015-05-21 09:29:01 -04:00
Andy Meneely 14e04a89c7 Started the star feature
Contributes to #72

[skip ci]
2015-05-21 09:29:00 -04:00
Andy Meneely ae1a7bd084 Set a non-symbol default for text embeds
Fixes #73, but in #74 we'll get it right.
2015-05-20 18:30:08 -04:00
Andy Meneely 0154b13e68 Use cairo context wrapper for fill colors on marketing
Actually deliver what I promised

Fixes #71
2015-05-19 16:49:13 -04:00
Andy Meneely 31b583d134 Implementation of hand 2015-05-19 14:40:21 -04:00
Andy Meneely 824e26d2c2 Hacked together a basic example to work from 2015-05-13 09:42:14 -04:00
Andy Meneely f0f9b7680d Starting a basic hand command 2015-05-11 23:30:30 -04:00
Andy Meneely d80d3884b1 Cleanup 2015-04-30 11:48:47 -04:00
Andy Meneely dab544a53b Add ellipse method
Also experimenting with using stroke_preserve, which in turn may make the other methods less repetitive.

Closes #66
2015-04-30 11:48:21 -04:00
Andy Meneely 71defb9e33 Fix color handling with text outline stroking
Needed to set squibcolor prior to translating the coordinate system so that gradients are relative to the card (as is documented). This also means stroking is done AFTER drawing the text, which looks better anyway.
2015-04-30 09:54:41 -04:00
Andy Meneely e974880e03 Add 'data' field to svg method for loading XML directly
Implements #65
2015-04-29 16:49:38 -04:00
Andy Meneely ca70b88be9 Cleanup 2015-04-28 22:31:04 -04:00
Andy Meneely 7c69cad506 Text: outline a string with a color or gradient
Fill color is still the same with 'color' (i.e. can be overridden by markup still), but now there's a stroke_width and a stroke_color option that, when stroke_width > 0, will draw an outline below the text. Since this isn't a Pango feature, we can't do markup for outlines. (Maybe make that a feature request to Pango if you want it.)

Implements #51
2015-04-28 22:27:26 -04:00
Andy Meneely 1c76d03e19 Dead code 2015-04-28 21:08:01 -04:00
Andy Meneely 1dc89ae76a Port global text hints to the new conf 2015-04-28 21:01:49 -04:00
Andy Meneely 923f346575 Redesigning how config files are read, stored, and delegated
With the new design, we take the load off of deck.rb and simply delegate methods over to the new conf.rb. This means that things like `antialias` is now available as a method to the normal Squib scripts for easy checking (without being mutable). Squib::Conf also handles parsing and defaults, and any potential input validation we need to do in the future.

Typographer is also set up now as a deck-wide configuration. This may change in the future if we want typography customization per-command, although that seems like a strange use case.

Lots of tests for this one, and lots of cross-cutting concerns in this commit.

This commit also includes some tweaks to rspec tests, including tagging of slow tests for a `rake spec_fastonly`

Conflicts:
	spec/samples/samples_regression_spec.rb
	spec/spec_helper.rb
	squib.sublime-project
2015-04-28 20:31:53 -04:00
Andy Meneely 25773a8ee5 Better regression tests for roo 2015-04-27 08:50:03 -04:00
Andy Meneely 035cd6259e Fix global hinting logic
Fixes #63
2015-04-16 21:24:21 -04:00
Andy Meneely a64e608b0a Onward and upward. 2015-04-16 20:56:01 -04:00
Andy Meneely 4a0c5e78b6 Fix PDF scaling issue
Properly compute the size of the PDF based on DPI and PDF-specific resolution (i.e. 72dpi).

Closes #62
2015-04-13 22:59:34 -04:00
Andy Meneely a47e26535d Starting a bugfix version 2015-04-13 22:49:42 -04:00
Andy Meneely 8ec0a5e09a Onward and upward. 2015-04-13 21:44:37 -04:00
Andy Meneely fbefe098cc I dub thee v0.5.0 2015-04-13 21:42:39 -04:00
Andy Meneely 0616512bd6 Set font antialiasing from global antialiasing
This is a workaround until we get a proper solution in #59
2015-04-13 21:26:41 -04:00
Andy Meneely e268246337 Allow specific gray and subpixel choices for antialiasing 2015-04-13 21:01:46 -04:00
Andy Meneely 0e22c52b0f Fix up config defaults
Also: removing include because Yard is stupid.
2015-04-07 21:32:55 -04:00
Andy Meneely 063d5156d6 Allow configuration of typographical replacements, e.g. smart quotes
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 #50
2015-04-07 21:21:00 -04:00
Andy Meneely beb46a9e1c Place embedded icons based on byte offset
Fixes #57
2015-04-07 19:43:16 -04:00
Andy Meneely 211e7c13b3 Fix typography replacements with embeds
Enable embedded icons tests again
2015-04-07 12:20:40 -04:00
Andy Meneely a5d1cb60f2 Complete overhaul of smart quotes to "typographer"
See README for details

Contributes to #50
2015-04-07 00:16:06 -04:00
Andy Meneely 674397c005 Smart quotes!
Closes #50
2015-04-04 16:02:20 -04:00
Andy Meneely 874bdba8bc Fix a string replacement issue.
Contributes to #30
2015-04-04 09:33:04 -04:00
Andy Meneely 19cad2cdb8 Using a platform-specific fix for zero-width letters on embedding icons
Contributes to #30 and our zero-width letter woes.
2015-04-04 09:15:21 -04:00
Andy Meneely 84fa97a4d1 More debugging on this stupid error 2015-04-02 10:19:22 -04:00
Andy Meneely 91ba48f80b Explicitly saving and restoring the matrix 2015-04-02 10:14:08 -04:00
Andy Meneely c9f9235be7 Attempting travis fix by saving and restoring the matrix 2015-04-02 10:00:26 -04:00
Andy Meneely b123a132ef Better debugging to fix this travis issue 2015-04-01 10:19:46 -04:00