rmagick custom fonts as pictures - ruby

I'm using this script https://github.com/Joern/CustomFont/blob/master/custom_font.rb to generate pictures with text in a custom font.
It works fine.
Now I bought a very special font which works fine on my local working machine with this script.
On my server I also have Ubuntu installed, Ubuntu Server Edition.
So I synced my WebApp from my local machine to my server and then just saw that it doesn't use the font.
I installed it with fc-cache -vf and convert -list font lists the font as installed (also fc-list | grep "Innovage" brings "Innovage:style=Regular").
Strangely, rmagick just won't use the font.
In contrast, this works: convert -font Innovage-Regular -pointsize 72 label:Test test.jpg
Additionaly confusing: bringing the convert line from above into a ruby script, it doesn't use the font again.
Any other font does work, but because the font works on my local machine, it cannot have to do with the font.
So I guess the problem lies at rmagick.
It's the same rmagick and Imagemagick version as on my local machine.
I just can't get it, it's totally confusing me.
Yours, Joern.

okay the problem's solution lies at simple as it can be: the font was simply in the wrong font dir, so that it was installed by the system, but the font-dir, I compiled rmagick with, was different to the dir I put the font into.

Related

ttf2ufm_x2gs on Ubuntu 20.04

I use national delivery service windows software for genarating and printing labels installed with Wine. The program works fine, but when I try to print the document printer uses different fonts for barcode. They provided 4 different ttf fonts with program to install it on system. I've installed them on wine and now they are OK in program. But problem comes when I try to print the files with printer or with cups-pdf the result is that the bar code looks completly different. I found out that I should install those fonts to ghostscript which transforms, but there is a problem. When I try to install font using ttf2ufm_x2gs which should install font to ghostscript I get following error code in terminal:
/usr/bin/ttf2ufm_x2gs: 82: .: 3:To many files open
I copied default config.cfg to folder with fonts. Only change that I've made is added ENCDIR and MAPDIR paths.
The Windows software must not be embedding the fonts into the ps/pdf as needed. The Xserver might be using the fonts correctly to display the result yet ghostscript can't embed the fonts needed for printing. The TTF fonts have probably not been added to a Fontmap file in the ghostscript library path or fontpath as required. The ttf2ufm_x2gs looks very complicated just for setting up fonts to be used by ghostscript. I suspect your fonts and Fontmap are still not working with ghostscript as needed. I don't use CUPS so can't help with that. The CUPS probably runs ghostscript to send the job to the printer and ghostscript can't find the TTF fonts.
I use the /usr/share/ghostscript/fonts/ directory for my own fonts to keep them separate from the dist packages so they won't be disturbed by package updates. Then the /usr/share/ghostscript/fonts/Fontmap file can be edited to tell ghostscript how to locate your needed TTF files. Be sure the Fontname is correct because that is difficult to discover with TTF files. The fontforge program can give the correct Fontname if unknown.
The Fontmap result should have the 4 TTF fonts listed, for example:
% font in same directory
/Fontname1 (font1.ttf) ;
% font in different directory
/Fontname2 (/path/to/font2.ttf) ;
% alternate style
(Fontname3) (font3.ttf) ;
% alternate style in different directory
(Fontname4) (/path/to/font4.ttf) ;

TYPO3 can't read or create pdf thumbnails with imagemagick or graphicsmagick

I'm using TYPO3 CMS 7.6 with PHP 5.5.2 on a Windows Server 2012 (IIS), my Server administrator installed ghostscript, graphicsmagick 1.3.25 and imagemagick. Now I use graphicsmagick:
C:/GraphicsMagick/gm.exe
It works, test all graphic manipulation on install tool: Convert image formats to jpg or scaling or combining images ... only PDF Thumbnails or convert PDF to JPG isn't working.
Screenshot:
Error:
Read pdf
Image generation failed
ImageMagick / GraphicsMagick handling is enabled, but the execute command returned an error. Please check your settings, especially ['GFX']['im_path'] and ['GFX']['im_path_lzw'] and ensure Ghostscript is installed on your server.
The path to gm or im is correct, because the other formats are working fine.
[GFX][im_path] = C:/GraphicsMagick/
[GFX][im_path_lzw] = C:/GraphicsMagick/
Me and my system admin don't know why TYPO3 can't create PDF Thumbnails in backend and frontend. Maybe there's something with ghostscript .. but he can create pdfs via windows command line?!? So that's a TYPO3 Problem?!
Thanks for your help or hints. ..
No PDF Thumbnails , see backend
with installing GraphicsMagick also install Ghostscript on window Server. You can download Ghostscript from here https://www.ghostscript.com/download/gsdnld.html. Before downloading please check also the window is 64 bit or 32 bit.Then again check Environment>image Processing and Test Image. Then in "Image processing" everything is loaded successfully also "Read pdf" and "Read ai"
I have still the same problem. My TYPO3 7.6.24 LTS will not convert PDF- and AI-files to jpg. All other files are working.
Today I've update ghostscript 9.22 and graphicsMagic 1.3.23 on my windows server (IIS). Everything runs with 64bit now.
Successfully, I also tested GraphicsMagick to convert the pdf to jpg via command line cmd.exe, f.e.
"c:\Program Files\GraphicsMagick\gm.exe" -convert -geometry 160x130 c:\temp\test.pdf c:\temp\test123.jpg
But it won't work with TYPO3, see error on initial post ... now I've no idea anymore ..?! anyone else?
Have you also set the path of GraphicsMagick in TYPO3 admin panel settings>Configuration Presets>Image handling settings>write a path or select a path it should be like this screenshot as below

Getting error, ImageMagick/GraphicsMagick is not installed. windows

I am trying to use ImageMagick to manipulate photos in my rails app but when I upload the photo and post it I get this error,
"Picture Failed to manipulate with MiniMagick, maybe it is not an image? Original Error: ImageMagick/GraphicsMagick is not installed"
Also when I try do,
irb
require 'mini_magick'
filename = '/Users/me/tmp/testfile.jpg'
image = MiniMagick::Image.open(filename)
it gives error "gives error...MiniMagick::Invalid: ImageMagick/GraphicsMagick is not installed"
ImageMagick is added to the system path, and installed successfully, I can open imagemagick through the cmd line and bring up the interface, wondering if anyone can offer some help.
correct versions are installed of ImageMagick for my operating system.
Also vcomp120.dll is installed as well.
EDIT: This is just on the development sever, not, in production.
To answer, my own question, on the ImageMagick website binaries download section, windows x64 I used and there it has a list of three commands
magick logo: "logo.gif"
magick identify "logo.gif"
magick display "logo.gif"
I was getting error display: delegate library support not built-in '' (X11) # error/display.c/DisplayImageCommand/1888. with this. I then installed GraphicsMagick as per #Bonzo comment. Still had problems and read that alot of people were having trouble with converting images and installing the legacy utilities in the windows installer corrected this adding, convert.exe, mogrify, etc. I was then getting a error ...Wrong JPEG library version: library is 90, caller expects 62... I then searched and found that other peoples were having trouble with this error, and to remove the program that is having the conflicting "libjpeg" file, for me this was GraphicsMagic, I uninstalled and displaying images is fine now.
Also check your delegates configuration magick convert -list configure and make sure jpeg or whatever format is in there you are wanting to use.

Running Tika through tika-python in Windows produces encoding errors

I have python code that extracts text from pdf files using Tika Server through tika-python. It then stores the resulting output in individual json files.
The command I run to execute my script is
python extraction.py <full path to some local directory>
I'm using python 3.5
It works perfect in different MacBookPro computers.
It doesn´t work as expected in Windows, even using up-to-date Windows 10.
Some pdf files are processed, others produce an error such as:
'charmap' codec can't encode characters in position 3648-3649: character maps to <undefined>
I have tried changing the Code Page to 65001 and changing console font to Lucida Console, based on other questions posted on Stack Overflow, including 388490 (Unicode characters in Windows command line - how?) and 14109024 (How to make Unicode charset in cmd.exe by default?) and 1259084 (What encoding/code page is cmd.exe using?).
I also tried installing ConEmu (http://conemu.github.io/en/UnicodeSupport.html) and changing the default encoding for all consoles.
Other references mention win_unicode_console (https://github.com/Drekin/win-unicode-console) but the python patch recommended instructions are not working in my machine.
I use Anaconda as my python distribution.
I am interested in knowing how to be able to run my python code in Windows without having these encoding problems. From what I have read, this is not a problem with my python code nor with Tika Server but rather a Windows encoding issue.
Thank you all,
German

Cucumber not showing coloured output in windows

this is probably something really stupid but I can't work it out.
I upgraded my version of cucumber to v 0.10.0 and now the test's (running on Win 7) are not showing coloured output with the "pretty" formatter.
When tests are run it prints this error: *** WARNING: You must use ANSICON 1.31 or higher (http://adoxa.110mb.com/ansicon) to get coloured output on Windows
I have been to http://adoxa.110mb.com/ansicon but it's not obvious to me how I should be upgrading it. Anyone know how to upgrade my version of anscion?
One of the dev's at my work figured it out.
You need to
Download Ansicon from https://github.com/adoxa/ansicon/downloads and unzip it into a directory
with no spaces
Open a command prompt and cd to the folder where you unzipped it
Now, cd into either x86 or x64 (depending on your machine’s processor) and install it globally on
your machine (For example, D:\Cucumber\ansi160\x64)
Type ansicon.exe –i OR ansicon -i and press Enter
Any program that prints ANSI colors will now display properly on your machine.
Update as of today, http://adoxa.110mb.com/ansicon is no longer accessible.
Files have been uploaded to https://github.com/adoxa/ansicon/downloads.
I tried downloading from adoxa.3eeweb.com, but Chrome warned me that the file was "not commonly downloaded and could be dangerous."
So I opted with the file from github.
Besides that, I just followed the steps mentioned above and my output is now coloured.

Resources