-
Notifications
You must be signed in to change notification settings - Fork 88
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
Make cairo based examples more beginner friendly. #115
Comments
I don't think you should relocate those files; they depend on Vera.tff and VeraMono.tff in the current directory, and I also don't like that you are "demoting" cairo based examples versus graph-plotting Pillow-based, putting them into a sub-directory - they are equal and different ways of drawing.
This apparently probably means you perhaps mistakenly always run "run_all_examples_with_cario.py" in the directory above, where the two fonts are located ... like "./with_cairo/run_all_examples_with_cario.py" , or some other PATH-based magic ?
Also, if "run_all_examples_with_cario.py" is singular and different from the others, you should name it so - e.g. all capital, or starts with "00_..." etc?
if you put "if __name___ ..." in one set, you should put them in the other set too - as I said, they are two different ways of drawing, and intentionally kept the same, except where the drawing codes is different.
pycairo was unmaintained/under-maintained, and had python 2/3 forks, when I re-wrote the examples - yes, I wrote all of the *cairo* examples, to teach myself pycairo - hence the comments about switching to cairoffi ; since then, pycairo had been updated / unified. While the maintained-status with cairoffi may be in the opposite.
I think libtiff is only used for some very edge cases - mono bitmaps?
I don't think there is an infinite loop in woodle_cairo.py - ?
On Mac OS X, AppleEmoji is located in one of the system font folders; I didn't want to hard-code the path, but it is located in /System/Library/Fonts/ or /Library/Fonts (and depending on the version of OS, ttf or ttc) . You can symlink / copy the emoji font file to the current directory to run it. (as all the examples assume the font file is in the current directory).
Mostly I don't think you should put them into a different folder - unless you also put the other set into their own; and also I don't think you should modify only the cairo set for things like "if __name___ ..." . If you add those, add them to both sets.
I'll possibly have a look at what you did, and selectively merge some of the ideas (like the ARGB changes) into upstreams at some point; but do ping / remind me if I don't get around to it.
|
Thank you for reply quickly.
I think that is not so important thing(there's only 10 samples and the filename tells what it will do), but I can accept the idea. I like '00_' prefix better than all capitals.
Sorry I forgot to add.
Also, I don't think consistency is important between sets, because if differences exist we can learn more about python itself. Or, If the unifing is important, I think we should make the modules which contains only the diferences.
Really?! On my Windows 10, I can't install pycairo both python2/3 with pip, but I can cairocffi on both python2/3! Also I succeeded to install cairocffi on Mac OS, but haven't try pycairo on Mac. I'll try later.
Yes, but "glyph-mono+alpha-cairo.py (master)" does it when called with dummy arguments.
"Looks like infinite" case. Rarely one, but it can take over 10-times longer than major case.
OK, I understand. but sorry to say, it might be somewhat hard work for me than I did. Because I have some difficulty to run 'not cairo' samples currently.
Thank you for now. When I have the time to retry later, I will fix more issue splitted version of them. |
Okay, that's interesting - I am surprised that you have problens running the mathplotlib drawing set. They were the older ones, and I thought they are more platform-neutral. Cairo's support (I meant Cairo itself, not cairo's python bindings) on windows has been historically somewhat poor - the name "Cairo" came from "Xr" (greek "X" - "chi", pronounced "kai", and "r", "rho"), for "X render", and was initially somewhat tied to X11 / unix. |
I have had a quick look at the actual code - besides relocating, you also renamed the files (changing "-" to "_" in the file names). That makes diff'ing (with Anyway, I think it needs to be broken down into a lot of different commits. For example, the As I said, I'll put some of the ideas upstream gradually, when I get round to it. |
Yes, because I want to run them at once from 'run_all_examples_with_cario.py', due to |
I reformed examples which cooperating with "cairo", and placed at https://github.com/Suzumizaki/freetype-py/tree/examples_with_cairo. But I know too many fixed for one pull-request. Are there any ideas or should treat them as just for only my own use?
I did:
run_all_examples_with_cario.py
is added. Users can test at once for now.run()
function andif __name__ == '__main__':
block.*-cairo.py
is moved and renamedwith_cairo/*_cairo.py
.emoji_color_cairo.py
can use Segoe UI Emoji.bitmap_to_surface.py
)woodle_cairo.py
).Note:
I don't know how to correctly run
emoji_color_cairo.py
on Mac OS.Tested with:
Thanks.
The text was updated successfully, but these errors were encountered: