I'am using graphicsmagick to annotate an image. I've been able to apply font,pointsize etc,
but when I applied kerning, got the error as
TypeError: Object #gm has no method 'kerning'
Kerning is supported by Imagemagick but not graphicsmagick?
Is there any way to use kerning in graphicsmagick?
Or is there any alternative to Kerning in Graphimagick to have spacing between text?
Thanks
The -kerning option appeared in ImageMagick in December 2008, long after the ImageMagick/GraphicsMagick fork happened. It isn't available in GraphicsMagick.
Related
I'm displaying a diagram with graphviz and need emoji to display but I constantly get display errors as shown here:
in this case should be (1 😂🥰)
My understanding from graphviz font path attribute and dot guide pdf quoted below, I should be able to change the fontpath to load an emoji capable font like NotoColorEmoji.
For bitmap output, such as GIF or JPG, dot relies on having these
fonts available during layout. Most precompiled installations of
Graphviz use the fontconfig library for matching font names to
available fontfiles. fontconfig comes with a set of utilities for
showing matches and installing fonts. Please refer to the fontconfig
documentation, or the external Graphviz FontFAQ or for further
details. If Graphviz is built without fontconfig (which usually means
you compiled it from source code on your own), the fontpath attribute
can specify a list of directories3 which should be searched for the
font files. If this is not set, dot will use the DOTFONTPATH
environment variable or, if this is not set, the GDFONTPATH
environment variable. If none of these is set, dot uses a built-in
list.
The only information I can find on changing the fontpath is from a 10 year old question and dead links on graphviz.org.
At the moment I'm testing in repl.it so it's possible the path isn't jiving somehow.
End goal is to update my current docker image somehow with the font file.
So far it seems I haven't been successful in loading the font at all and I still have no guarantee it will display emoji. I'm open to other suggestions to display emoji (hopefully with graphviz).
digraph tree {
fontpath="/"
"foo" [label="bar", shape=triangle, color=black fillcolor=peru, style=filled, fontname="NotoColorEmojis"]
May you help me to use GDI+ (in RAD Delphi) to use a command as such:
Graphics.DrawString('text',-1,font,MakePoint(x,y),Brush)
following a path. In fact, I want to put a string text around a circle following the circus radius. I didn't succeeded to use the method DrawDriveString. I didn't find documentation on this subject for Delphi. Probably you may supply any.
I'm making a small program which is added to a PDF and created an image and some text. The problem is that using the function AddTrueTypeFont gives me errors either Invalid Variant Error or You can not use this statement in an automatic object.
I am using the Debenu Quick PDF Library, Lite version 1114 (DebenuPDFLibraryLite1114.dll).
In summary, I would like to know how I can put a text with font Verdana in the source.
My HTML file has some paragraphs where I am using an 8pt font-size. After converting the HTML to PDF, the paragraphs gain extra letter spacing and some letters are overlapped.
I tried all the suggestions from the following (like using dpi and xserver) but none are working.
http://code.google.com/p/wkhtmltopdf/issues/detail?id=72&q=letter
I realize that this question is a little bit old. But having received my fair share of frustration from this wkhtmltopdf letter-spacing issue, I want to drop a potential workaround:
'--dpi 96'
Add this option to the binary parameters, and you might be able to smile as I eventually did!
viz:
wkhtmltopdf --option1 --option2 --dpi 96 "www.host.com/page.html" file.pdf
In 2021 I fixed this by using 200 dpi.
Guys if you want to to get your PDF View as it looks in your Web Page copy the following code in your config/initializer/pdfkit.rb(create this file in initializer folder)
PDFKit.configure do |config|
config.wkhtmltopdf ='/usr/local/bin/wkhtmltopdf'
config.default_options = {
:encoding=>"UTF-8",
:page_size=>"Ledger",
:zoom => '1.3',
:disable_smart_shrinking=>false
}
end
Plese check this link for more ":page_size "attributes
wkhtmltopdf: What paper sizes are valid?
And discover new options by visiting this link
http://madalgo.au.dk/~jakobt/wkhtmltoxdoc/wkhtmltopdf-0.9.9-doc.html
Hope This all will help you. Thanks
Update wkhtmltopdf.
I found the best way to fix these letter spacing issues is to just ensure you're using the latest version of wkhtmltopdf (0.12.2.1 at the time of writing).
In Rails you can simply use the edge binary gem of this, like so:
gem 'wkhtmltopdf-binary-edge'
Give that a quick try first and see if your issues are fixed. Mine were.
I need to resize/crop images in different resolutions for Android App.
I know, that it's a common question, but I could not find a solution that would suit for me.
The problem is consist in the fact that different devices had different diagonal. The administrator upload to CMS only one image with size 668x1024 (for example). Then I need to send a picture to the device with such resolutions: 400x600, 540x960, etc. I can't just resize each image, because on the phone would appear a background-lines.
So, I'm or violating the aspect ratio (that's not good because picture becomes ugly) or should to crop the image. But because of the different proportions it's hard to do.
I tried mini-magick and g1nn13-image-science, but in the first one I can't take the current images width and height (and because of it I can't realize the cropping algorithm) and the second one gives me an error when I try to require image_science: "no such file to load -- inline"
All help and advices appreciated: some decisions about How To do it (maybe not to do cropping, but some another decision?) or gems that could help me.
Thanks.
ANSWER:
I used fastimage gem for finding picture's current height and width and the method of minimagick gem image.shave.
Example:
current_w, current_h = FastImage.size(object.attach.path)
if current_w < current_h
remove_h = ((current_h - height)/2).round
image.shave("0x#{remove_h}")
remove_w = ((current_w - width)/2).round
image.shave("#{remove_w}x0")
end
There is good gem called dragonfly for rack apps.
Basically you save base image, and then you can pass resolution in the request, and it saves new size in the cache.
Here is some introduction to this gem
Overview:
Android ==(400x600)=> Rails(ImagesController#show) ===> image_url(400x600).jpg
Maybe this fits your needs,
http://www.gra2.com/article.php/using-rmagick-imagemagick-rails
if you don`t want to use any gem you can reach the installed programms with the rails
system
command.
Try to use paperclip, it uses ImageMagick and allows to specify its cropping algorithm, for example:
400x600^
400x600#
400x600>
The ^ # and > are described here
https://github.com/thoughtbot/paperclip