Comments (9)
Here is a page that describes several implementations of rounded rectangles for cairo which is a vector library with primitives like pdf
http://cairographics.org/cookbook/roundedrectangles/
from prawn.
Definitely will accept a patch for this, but it needs to be on a fork with tests and examples
from prawn.
Definitely will accept a patch for this, but it needs to be on a fork with tests and examples
Question about this:
When I was making my star shape the other day, I wondered how one would write specs for it. The spec for, as an example, ellipse_at in the Prawn spec suite does test that the API hasn't changed, and that the pointer is back at the center of the ellipse, but it doesn't really test that an ellipse has been drawn, just the last point.
I guess one could create an example, render it, go into the resulting PDF and extract the generated points, and then create a regression test spec.
Do you have guidance on this, Greg?
Thank You,
Daniel
from prawn.
Yeah, good point. Just write some nice examples, and make sure that the API gets tested, and that if we're moving the pointer, it goes to the right place.
from prawn.
Not sure where jontebol got to but I went ahead as suggested by Greg (http://groups.google.com/group/prawn-ruby/browse_frm/thread/791dc2cb72a6ee0f) and took Salamandra's code and fixed it so that it will fill_and_stroke: http://github.com/jonsgreen/prawn/commit/059e035e55a3334d19345db0711a130aae39adeb. My spec is a bit contrived but at least it exercises the code.
from prawn.
I started, but then I had to focus on other things. I was still planning to do this though, possibly within a month or 2, but if you've fixed it already, that's great. :)
from prawn.
Sweet, we'll pull this in for 0.8, then.
from prawn.
I have made an improvement by implementing rounded_polygon making rounded_rectangle just a subset example (http://github.com/jonsgreen/prawn/commit/0b55e7da57c0f5da07fedf138ad197ca58072e6d) I did not add any specs for this method so far relying on the rounded_rectangle spec to exercise the polygon code. Let me know how I might improve the spec coverage for this feature if it is accepted. There is also a clever little pentagram in the rounded_polygon example.
from prawn.
Merged, thank you.
from prawn.
Related Issues (20)
- No way to give dynamic-height bounding boxes a background color HOT 1
- Incompatibility with ruby 3.1 HOT 1
- "Cursor" with repeater dynamic not working HOT 3
- Error in the manual? (page 11) HOT 2
- Issue with image colors when converting to PDF HOT 1
- Question about re-using some Prawn code to render appearance streams for AcroForm annotations HOT 2
- Push New Version to Ruby Gems to Deal with Ruby 3.1 Removing Matrix HOT 6
- Setting multi page table top margin
- Does this gem support chartjs?
- PDF/A-1
- PDF/A-3
- Rails 7.X ActionView::Base.full_sanitizer.sanitize(Prawn::Text::NBSP) returns " " HOT 1
- [FR] OpenType Support, Enable/Disable Ligatures and Multiple weight settings HOT 8
- Subtable with colspan and multi-line text breaks across pages
- Grid broken if no gutter defined HOT 5
- TypeError: can't convert nil into Float HOT 1
- The Return of the Embedded Font Issue HOT 15
- Font error with 2.5 and Adobe Acrobat HOT 4
- Circular require warning in prawn 2.5.0
- Question / Feature Request: Is it possible to layout text into a fixed number of rows?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prawn.