-
-
Notifications
You must be signed in to change notification settings - Fork 585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
glyphBounds and glyphAdvance return hard coded values #22
Comments
Yes, those functions are correctly implemented with ttf fonts. |
Thanks for the pointer. |
My first attempt at a document generator that has text that will wrap for both line and page can be found https://github.com/magnatronus/flutter-pdf-doc thanks for the help so far! |
@magnatronus, I'm writing a Flutter-like Widget system wor this Pdf library. It is available in the It would look like this: var pdf = Document();
pdf.addPage(Page(
child: Column(children: <Widget>[
Text("Hello World"),
Image(image),
Shape(shape),
])
)); |
@DavBfr , if I can help sure, I will take a look. |
@DavBfr I have been having a look at the widgets branch and have come across a few issues with the way it is currently set up. You have defined your own classes called, for example, StatelessWidget, Widget, LimitedBox , Context, but as Flutter already has these defined when in a Flutter environment they clash with the Flutter classes. I know they could be name-spaced but as they are a fundamental part of the underlying Flutter building blocks I wondered whether they should be prefixed , maybe with Pdf to make they unique to your library? |
I have been looking at allowing text wrap, and from your suggestion have been attempting to use stringBounds().
This issue I have is that the both glyphBounds() and glyphAdvance() return hard coded values, therefore it is impossible to accurately use stringBounds() to determine the length of a string.
for example:
stringBounds() says these are the same length, but they are not a W is wider that i.
Is there any other way of accurately determining the wide of a string, or is it that this is currently not possible?
The text was updated successfully, but these errors were encountered: