-
Notifications
You must be signed in to change notification settings - Fork 15
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
GNU+Linux support #40
Comments
Nobody that I know of works on PageBot implementation running outside DrawBot. It would be interesting to have one running on Google Apps Python server. We did experiments in the past there, but stopped because the SQL version was not 100% standard at the time (missing the "or" in queries). What needs to be implemented is the imports of DrawBot functions (rect, oval, text, and such) and then make the imports in TextBox conditional. CoreText is used by TextBox FormattedString, to know where lines and runs are located. And to calculate overflows of text. If we make an alternative for FormattedString (e.g. use the element.html storage instead), then all could work with tagged strings and etree representations of it. |
thanks, @petrvanblokland ! |
http://xxyxyz.org/flat is the library and http://xxyxyz.org/even is the ui app https://github.com/xxyxyz/flat https://github.com/xxyxyz/even These use Qt, whereas pagebot/drawbot uses Cocoa. I don't have any sense when Qt will support variable fonts, but everything else should be possible to do with Flat. Cc @sukop |
Interesting. Let's see on what level we can make it compatible.
From what I see, it is covering a large part of DrawBot, except for API differences and naming.
Currently DrawBot does the difference between DrawBot and HTML/CSS as
e.draw(...) for DrawBot, using a View and an local origin.
e.build(...) for building text/tagged base output using a View and a Builder.
What would you think as best approach to extend to Flat:
1) Add a method e.flatDraw(...) for every element, which is most direct but less extendable.
2) Make the DrawBot call indirect and let the difference be handled by an abstract Drawer (such as Builder already is).
I need to think about it. 1) is probably most flexible.
|
The goal I have in mind (and I think Felipe shares, given his "naieve" attempt to run (Of course "works the same" is not in the TeX sense that it will be dot for dot, pixel for pixel the same, but that it should not raise any exceptions, and give approximately the same results.) However, it may be that option 1 is a way point to option 2, since the abstract Drawer wrapper needs to wrap around both Flat and Drawbot classes/methods. |
That would work for 1) and 2). Currently the a view already decides whether to call page.draw(...) or page.build(...). A view can figure out if DrawBot is available or Flat. |
Oh! Very good!! :) Yes, elements accessing this directly could open interesting possibilities - I think there are some thing Flat/Drawbot can do that the other can not, due to differences in the underlying platforms which they wrap, and there will surely be other drawing platforms in the future... :) |
It's the trade-off between redundancy in code and flexibility. |
Variable fonts will already work, because PageBot+fonttools save instances as TTF/CFF that are then installed as regular fonts. Same way as it now works in DrawBot. |
Currently making drawBotBuilder as abstract builder, so we can add flatBuilder. |
I'm probably working for the rest of the coming days weaving together flat and drawbot as separate views and builders. |
Awesome! Thanks a lot for this work, Petr ! |
I think that is a very interesting point, to add to the introductory documentation about the code architecture :)
Oh!! I didn't appreciate this; I (mis)remembered from the Typographics workshop that the CoreText FormattedString was what powered variable fonts support, I didn't understand it was 'pogo' style :)
Perhaps @felipesanches can help with that |
@felipesanches What is the closest equivalent of OSX FormattedString that we could get in Flat? Plain unicode string? Or HTML tagged? Or something else? |
I'll have to dive into it for a while before being able to answer that question. But I'd be delighted to do so. |
I'm new to flat (just heard of it from @davelab6 this morning here in this thread). The kind of work done by FormattedString in DrawBot seems to be similar to things that pango and harfbuzz do such as describing a layout, applying styles to chunks of text and then performing itemization/shaping. If I got it right, then it seems that this code in flat does some portion of that: |
Yes, the closest equivalent of macOS FormattedString is |
Hello! I'm not quite up to speed with your effort but here are few notes that might be useful:
For the purpose of interop, I think the greatest difference is that DrawBot follows PostScript way of drawing, i.e. there is a global graphic state of which properties such as line width and color can be altered and which is then used for painting. Whereas in Flat one creates instances of style (drawing of shapes) and strike (drawing of text) and then using these "factories" one creates and places concrete graphic objects on the page.
In Flat, one first loads a font to pass it into "strike" constructor. a "strike" is then set up with particular typographic properties, which is the used to create a "span". Spans build up "paragraph", paragraphs build up "text", which can then be broken into various text "blocks" placed on pages. To answer your question, yes, "text.py" is the place to look into. To get the width of some span, use If you have any more question, please ask. |
On Sep 19, 2017, at 1:44 PM, Dave Crossland ***@***.***> wrote:
Yes, the closest equivalent of macOS FormattedString is flat.text.strike() http://xxyxyz.org/flat#reference <http://xxyxyz.org/flat#reference>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#40 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAXBwVkSLl4YX8YQ44mbpGxVA9H8bh8fks5sj_1xgaJpZM4Pbjm4>.
Implementing the space to hold that next to OSX-FS and tagged string.
…-----------------------------------------------
Petr van Blokland | twitter+skype @petrvanblokland
Intentionally not on FaceBook.
buro@petr.com | www.petr.com
mobile +31 6 24 219 502 | buro +31 15 887 1233
-----------------------------------------------
typetr.typenetwork.com
-----------------------------------------------
Rietveld 56 2611 LM Delft The Netherlands
-----------------------------------------------
Claudia Mens | claudia@petr.com
mobile +31 6 41 367 689 | buro +31 15 887 1233
-----------------------------------------------
|
On Sep 19, 2017, at 2:44 PM, Juraj Sukop ***@***.***> wrote:
Hello!
I'm not quite up to speed with your effort but here are few notes that might be useful:
[Flat] is covering a large part of DrawBot, except for API differences and naming
For the purpose of interop, I think the greatest difference is that DrawBot follows PostScript way of drawing, i.e. there is a global graphic state of which properties such as line width and color can be altered and which is then used for painting. Whereas in Flat one creates instances of style (drawing of shapes) and strike (drawing of text) and then using these "factories" one creates and places concrete graphic objects on the page.
PageBot can support both ways, because all drawing is done in one recursive drawing call, which can go either way to different methods. Until then all Element instances keep their data inside, which can be altered and moved until rendering starts.
What is the closest equivalent of OSX FormattedString that we could get in Flat?
In Flat, one first loads a font to pass it into "strike" constructor. a "strike" is then set up with particular typographic properties, which is the used to create a "span". Spans build up "paragraph", paragraphs build up "text", which can then be broken into various text "blocks" placed on pages.
To answer your question, yes, "text.py" is the place to look into. To get the width of some span, use style.width (the raw result for a font is scaled by unitsPerEm and current text size in pt) and for the height search for rmq (range minimum query). So to put a rich text on the page, one basically creates a sequence of spans, such as `page.place(text(paragraph(red.span('Hello '), blue.span('world!'))).
If you have any more question, please ask.
Thank you for now.
… —
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#40 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAXBwScd_BV8vY7ppezLJCeHYyqncPIaks5skAt1gaJpZM4Pbjm4>.
-----------------------------------------------
Petr van Blokland | twitter+skype @petrvanblokland
Intentionally not on FaceBook.
buro@petr.com | www.petr.com
mobile +31 6 24 219 502 | buro +31 15 887 1233
-----------------------------------------------
typetr.typenetwork.com
-----------------------------------------------
Rietveld 56 2611 LM Delft The Netherlands
-----------------------------------------------
Claudia Mens | claudia@petr.com
mobile +31 6 41 367 689 | buro +31 15 887 1233
-----------------------------------------------
|
@petrvanblokland Let me know if there's any way I can help here. I may be able to dedicate some time to this effort next Thursday and Friday. |
Currently dividing my type between PageBot, Variable font spec and TYPETR new releases. So a bit slower than last week.
Basically the structure is there, supporting contexts now that can include DrawBot, Flex or others as drawing canvas, and views that make the difference of the type of output (drawing, HTML/CSS, movie) with their parameters.
I did not manage to get all examples back on track for DrawBot. This all lives in the other branche.
We need to define the overlap and diff between DrawBot/Flex functions and syntax call of the functions.
Some directly address the context.b builders (drawbot and flex modules) or the function is in the context, if there is no direct context.b function available (e.g. No Spot colors in DrawBot).
There is a lot to do, let me know what you can. Or we can hangout if you have questions.
Also added a View (similar to MampView and GitView) that will be able to make static pages and submit them soon Google Cloud to App as running PageBot. But that part still needs to be developed.
P
… On Oct 3, 2017, at 4:03 PM, Felipe Corrêa da Silva Sanches ***@***.***> wrote:
@petrvanblokland <https://github.com/petrvanblokland> Let me know if there's any way I can help here. I may be able to dedicate some time to this effort next Thursday and Friday.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#40 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAXBwUlUfLYBFKqBj485q_TGmHRWY9VUks5sopMPgaJpZM4Pbjm4>.
-----------------------------------------------
Petr van Blokland | twitter+skype @petrvanblokland
Intentionally not on FaceBook.
buro@petr.com | www.petr.com
mobile +31 6 24 219 502 | buro +31 15 887 1233
-----------------------------------------------
typetr.typenetwork.com
designdesign.space
-----------------------------------------------
Rietveld 56 2611 LM Delft The Netherlands
-----------------------------------------------
Claudia Mens | claudia@petr.com
mobile +31 6 41 367 689 | buro +31 15 887 1233
-----------------------------------------------
|
hey, @petrvanblokland ! I considered looking at this in more detail today and by reading your previous message here I had the impression that some new code was written based on the discussions of this github issue thread. But looking at the master branch I don't see any new commit related to this. Perhaps your working on a separate branch for this? |
OK. I think I found it. It seems to be the new_views_builder branch, right? Can you confirm that? |
Yes, that is right
… On Oct 19, 2017, at 5:02 PM, Felipe Corrêa da Silva Sanches ***@***.***> wrote:
OK. I think I found it. It seems to be the new_views_builder branch, right?
Also, it seems to me that your first commit related to this issue was this: bf071b6 <bf071b6>
Can you confirm that?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#40 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAXBwfMwcvP-qcBAEh52NQdj0fRYnu-Xks5st2SPgaJpZM4Pbjm4>.
-----------------------------------------------
Petr van Blokland | twitter+skype @petrvanblokland
Intentionally not on FaceBook.
buro@petr.com | www.petr.com
mobile +31 6 24 219 502 | buro +31 15 887 1233
-----------------------------------------------
typetr.typenetwork.com
designdesign.space
-----------------------------------------------
Rietveld 56 2611 LM Delft The Netherlands
-----------------------------------------------
Claudia Mens | claudia@petr.com
mobile +31 6 41 367 689 | buro +31 15 887 1233
-----------------------------------------------
|
Thanks! Please merge the trivial syntax error fix at #43 |
There's a relevant comment at fe192ee @petrvanblokland said at that commit:
|
I'm looking for an example of a script that was already "upgraded" to not call drawBot directly. So that I could replicate that kind of refactoring in all the other examples. |
Look for sources that do this
from pagebot.contexts import defaultContext
They should be aware of the new layer.
… On Oct 19, 2017, at 5:45 PM, Felipe Corrêa da Silva Sanches ***@***.***> wrote:
I'm looking for an example of a script that was already "upgraded" to not call drawBot directly. So that I could replicate that kind of refactoring in all the other examples.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#40 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAXBwZQsRwhFzI8L48l83tRKqcijtvWtks5st26lgaJpZM4Pbjm4>.
-----------------------------------------------
Petr van Blokland | twitter+skype @petrvanblokland
Intentionally not on FaceBook.
buro@petr.com | www.petr.com
mobile +31 6 24 219 502 | buro +31 15 887 1233
-----------------------------------------------
typetr.typenetwork.com
designdesign.space
-----------------------------------------------
Rietveld 56 2611 LM Delft The Netherlands
-----------------------------------------------
Claudia Mens | claudia@petr.com
mobile +31 6 41 367 689 | buro +31 15 887 1233
-----------------------------------------------
|
@petrvanblokland I'm back at it today! Back when I last dealt with it I ended up making several miscellaneous code changes attempting to adapt the code to become truly cross-platform. I was still unable to run even a simple script on GNU+Linux. I tried to create some simple / minimal example script but the best I was able to get was a blank PDF as output. I'll continue tweaking the codebase here, but I would appreciate if someone could provide a very minimalistic sample script accompained with an explanation of what it does and what's expected as correct output. A reference output file would be surely good as well, so that I have something to compare against while trying to get it to work. |
On 4 Dec 2017, at 21:58, Felipe Corrêa da Silva Sanches ***@***.***> wrote:
@petrvanblokland <https://github.com/petrvanblokland> I'm back at it today!
Back when I last dealt with it I ended up making several miscellaneous code changes attempting to adapt the code to become truly cross-platform. I was still unable to run even a simple script on GNU+Linux.
I tried to create some simple / minimal example script but the best I was able to get was a blank PDF as output.
I'll continue tweaking the codebase here, but I would appreciate if someone could provide a very minimalistic sample script accompained with an explanation of what it does and what's expected as correct output. A reference output file would be surely good as well, so that I have something to compare against while trying to get it to work.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#40 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAXBwVQoW_Yfptac9dOhAGlP6RVR__Dkks5s9FzpgaJpZM4Pbjm4>.
Let’s coordinate some very small samples, to get them to work.
I’ll work on this tomorrow and point you to them.
P
…-----------------------------------------------
Petr van Blokland | twitter+skype @petrvanblokland
Intentionally not on FaceBook.
buro@petr.com | www.petr.com
mobile +31 6 24 219 502 | buro +31 15 887 1233
-----------------------------------------------
Rietveld 56 2611 LM Delft The Netherlands
-----------------------------------------------
Claudia Mens | claudia@petr.com
mobile +31 6 41 367 689 | buro +31 15 887 1233
-----------------------------------------------
|
Great! Thanks! |
We have the first small script to work: HelloCircleSquare.py, making 3 png files with random circles and square. |
thanks, @petrvanblokland ! |
Once we have rudimentary formatted text functions (through FlatString(BabelString) usage), we can start making documents+elements works with Flat. |
On 6 Dec 2017, at 14:07, Felipe Corrêa da Silva Sanches ***@***.***> wrote:
thanks, @petrvanblokland <https://github.com/petrvanblokland> !
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#40 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAXBwdQPw97elD6Uq6vCUoeYeunYDjgiks5s9pGNgaJpZM4Pbjm4>.
Example HelloCircleSquare.py now works with text string.
I am testing this on osX-terminal-cmd-line in plain Python.
Seems to run fine. Does is work in Linux?
…-----------------------------------------------
Petr van Blokland | twitter+skype @petrvanblokland
Intentionally not on FaceBook.
buro@petr.com | www.petr.com
mobile +31 6 24 219 502 | buro +31 15 887 1233
-----------------------------------------------
Rietveld 56 2611 LM Delft The Netherlands
-----------------------------------------------
Claudia Mens | claudia@petr.com
mobile +31 6 41 367 689 | buro +31 15 887 1233
-----------------------------------------------
|
I suppose that with that first major step I can slowly start expanding support for all the rest! :-) |
I'll work from the other side, making more existing examples work through context. |
VERY EXCITING!!! :D
|
:-D |
Known bug. They curves are not ok too, but it was used as background for drawing flourishes in a typeface that we are working on. I did not need the middle part for that.
… On 1 Feb 2018, at 21:34, Felipe Corrêa da Silva Sanches ***@***.***> wrote:
Examples/Howto/DrawSpirals.py works, but the center looks funny. It seems to be some bad math on the example script itself, rather than a PageBot problem.
<https://user-images.githubusercontent.com/213676/35701861-7327e29a-077e-11e8-96a9-da57f76c4877.png>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#40 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAXBwRKI_L_egaU9Nst8f6ZRXqNpc4wCks5tQh_PgaJpZM4Pbjm4>.
-----------------------------------------------
Petr van Blokland | twitter+skype @petrvanblokland
Intentionally not on FaceBook.
buro@petr.com | www.petr.com
mobile +31 6 24 219 502 | buro +31 15 887 1233
-----------------------------------------------
Rietveld 56 2611 LM Delft The Netherlands
-----------------------------------------------
Claudia Mens | claudia@petr.com
mobile +31 6 41 367 689 | buro +31 15 887 1233
-----------------------------------------------
|
I've hit on a roadblock in the past few hours here: #96 |
I will have a look tomorrow.
… On 2 Feb 2018, at 03:00, Felipe Corrêa da Silva Sanches ***@***.***> wrote:
I've hit on a roadblock in the past few hours here: issues/96
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#40 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAXBwY_aH1ixq0YVuEKPMFyJ3GJqQPdSks5tQmwpgaJpZM4Pbjm4>.
-----------------------------------------------
Petr van Blokland | twitter+skype @petrvanblokland
Intentionally not on FaceBook.
buro@petr.com | www.petr.com
mobile +31 6 24 219 502 | buro +31 15 887 1233
-----------------------------------------------
Rietveld 56 2611 LM Delft The Netherlands
-----------------------------------------------
Claudia Mens | claudia@petr.com
mobile +31 6 41 367 689 | buro +31 15 887 1233
-----------------------------------------------
|
thanks! |
Closing this issue means that PageBot works nicely on GNU+Linux now? I'm not so sure about that, but I haven't been following this closely lately, so let me know it there's something new that I'm still not aware of. |
Hi, the core PageBot functions should work pretty smoothly on Linux now. Most of the files in the examples repo run both the Flat and the DrawBot context, with pretty much the same output (some pixel offsets on font baselines here and there). There's still some more specific parts of the DrawBot implementation to deal with in Flat but I'm putting those in separate issues. |
great, thanks! :-D |
https://en.wikipedia.org/wiki/Core_Text
I think @davelab6 mentioned something about someone working on an implementation of a free software substitute for that already?
I'd love to contribute to PageBot once this issue is sorted out.
cheers,
Felipe Sanches
The text was updated successfully, but these errors were encountered: