cairo

Change font rendering (non-antialiased) with pango

会有一股神秘感。 提交于 2020-01-03 04:49:12
问题 How do I render a string with pango using custom antialiasing and hinting settings? I tried PangoCairo.set_antialias(cairo.ANTIALIAS_NONE) (in pygtk), but it had no effect. I'd like to be able to change freetype's rendering parameters, like I can do via fontconfig/ fonts.conf , but at runtime. (This is on Linux.) Any ideas? 回答1: Well, I'm not sure if understood you right, but I usually use cairo_set_antialias () in my C-code, though I don't know an equivalent in PyGTK. As far as I understand

Cannot create dylib for distribution that works on OS X 10.5 (building in 10.6 environment)

流过昼夜 提交于 2020-01-02 17:13:11
问题 I'm trying to distribute cairo (1.10.2) with my application. I can create the necessarily dylibs using Homebrew but they are dependent on versions of other dynamic libraries that aren't present in OS X 10.5 (libfontconfig, libfreetype, and others located primarily in /usr/X11/lib ). I assume to solve this I want it to be using the dylibs in /Developer/SDKs/MacOSX10.5.sdk/usr/X11/lib rather than the libraries in /usr/X11/lib . I've tried anything I could find for targeting cairo against the 10

How to use Cairo PNGs in R Markdown

好久不见. 提交于 2020-01-01 08:44:49
问题 There are many advantages to using Cairo to save R graphics (see here, for example). When saving PDFs, for instance, the cairo_pdf device correctly embeds custom fonts. Using the cairo_pdf graphics device is easy with ggplot-based graphics with ggsave() : library(ggplot2) ugly_plot <- ggplot(mtcars, aes(x = wt, y = mpg)) + geom_point() + labs(title = "Some data about cars") + theme_gray(base_family = "Papyrus") ugly_plot ggsave(ugly_plot, filename = "ugly_plot.pdf", width = 4, height = 2.5,

Pango + Cairo; is there an existing approach for handling <img> style tags in text?

心不动则不痛 提交于 2019-12-30 09:16:47
问题 Pango syntax supports some text only markup. As far as i can see this does not extend to embedding images as well. Looking around I cannot find much in the way of an existing implementation, but i havent done pango+cairo work before so i might be missing the obvious community for it. As far as i can tell a reasonable approach would be to just analyse a string, pull out any tags, create cairo images, and then modify the pango layout around them accordingly. It also seems like something someone

Pango + Cairo; is there an existing approach for handling <img> style tags in text?

↘锁芯ラ 提交于 2019-12-30 09:15:12
问题 Pango syntax supports some text only markup. As far as i can see this does not extend to embedding images as well. Looking around I cannot find much in the way of an existing implementation, but i havent done pango+cairo work before so i might be missing the obvious community for it. As far as i can tell a reasonable approach would be to just analyse a string, pull out any tags, create cairo images, and then modify the pango layout around them accordingly. It also seems like something someone

Homebrew R build missing Cairo

空扰寡人 提交于 2019-12-30 06:43:26
问题 I installed R on an OSX 10.7.5 server using brew: brew install R Everything seems so OK far, however Cairo is not working: > svg(tempfile()) Warning messages: 1: In svg(tempfile()) : unable to load shared object '/usr/local/Cellar/r/2.15.2/R.framework/Resources/library/grDevices/libs//cairo.so': dlopen(/usr/local/Cellar/r/2.15.2/R.framework/Resources/library/grDevices/libs//cairo.so, 6): image not found 2: In svg(tempfile()) : failed to load cairo DLL The shared object file seems to be

How do I install Cairo binaries for Python

时间秒杀一切 提交于 2019-12-25 03:13:55
问题 I am trying to install Cairo for Python 2.7 in windows. I have installed igraph. There are binaries for this system on Christoph's site. I have downloaded the appropriate binary. How do I use pip to install the Cairo binary. 回答1: I worked on it and figured it out. Here are detailed instructions. They will work (with appropriate modifications for any binary Python package: Installing Cairo in Python for Windows. Go to site http://www.lfd.uci.edu, Chrisoph Gohlke’s site Download the appropriate

When a python module (cairo) is installed successfully but fails to import in python, what could be the issue?

痞子三分冷 提交于 2019-12-24 11:27:33
问题 When a python module is installed successfully but fails to import in python (via PyCharm IDE), what could be the issue? What checklist should I follow to diagnose the problem in this case and in the future when a module installs but later fails to import? For this specific case, I installed a vector graphics module for Python called cairo . http://cairographics.org/releases/pycairo-1.8.8.tar.gz See the successful install below: sudo python setup.py install cairo >= 1.8.8 detected creating

Can I specify scaling when using the cairosvg module inside of python

妖精的绣舞 提交于 2019-12-24 10:58:25
问题 The command line version of cairosvg allows scaling. Here is the output of the help function: cairosvg -h usage: cairosvg [-h] [-v] [-f {pdf,png,ps,svg}] [-d DPI] [-W WIDTH] [-H HEIGHT] [-s SCALE] [-u] [-o OUTPUT] input CairoSVG - A simple SVG converter based on Cairo. positional arguments: input input filename or URL optional arguments: -h, --help show this help message and exit -v, --version show program\'s version number and exit -f {pdf,png,ps,svg}, --format {pdf,png,ps,svg} output format

No module named cairo - Mac

杀马特。学长 韩版系。学妹 提交于 2019-12-24 10:47:19
问题 Why is it so effin' hard? Seems to be an ever-present issue..solved unclearly. Searched on multiple github pages, advised to use import cairocffi as cairo instead, not working for me. Some more on Stackoverflow, to add sys.path.insert(0, "//anaconda/pkgs/cairo-1.14.10-0") or something. But in fact, sys.path returns the directory anyway. Quite sure installation done correctly as I can see under conda list . Bad feeling this is gonna take a whole lot longer due to my little understanding of the