Showing posts with label Inkscape. Show all posts
Showing posts with label Inkscape. Show all posts

Wednesday, 1 July 2020

Find missing fonts using Inkscape 1.0 or earlier

Problem:

Using Inkscape, how do I find which fonts are missing but needed in my svg project?

I have moved svg inkscape image files from one machine to another and the new machine is missing fonts the old machine has.

Workarounds:

There are a few indirect ways to find fonts that are missing but required by a project in Inkscape. A few of which are shown below. These might not find all the missing fonts, but they should be a good start in your search.

Hopefully these workarounds help until Inkscape includes a feature for this.

1. Text and Font panel

The first way is to open the "Text and Font" panel and have a look at what fonts have a red line through it. Assuming your project has already been opened:

  1. Find the "Text and Font..." dropdown menu item and select it 
  2. In the "Text and Font" panel, have a look at which fonts have a red strikethrough

2. List all fonts and then manually check

Assuming that you know what fonts are installed in your system (or how to find out), you can also list all fonts used in your project and then compare them with your known installed fonts.

To find the names of all fonts used in your project:

  1. In the extensions menu, navigate to "Replace font..."
  2. Then go to the "List all fonts" tab and hit "Apply".
    .
  3. If all goes well then the fonts should be listed
  4. Use this list to compare to your system's installed fonts.

3. Click on text that looks incorrect

When you click on text elements that look incorrect because fonts are missing, Inkscape will show you the font name and an icon indicating that the font is missing.

This should work well for anyone with simpler projects, or projects that only have one or two fonts missing.

References:

Tuesday, 16 January 2018

XQuartz move offscreen windows back on-screen in macOS/OS X

Problem:

I have several XQuartz/X11 windows in macOS/OS X that are offscreen. I want to move them on-screen so I can save my work.

Example scenario:

You can create an example of off-screen X11 windows when using macOS/OS X with an external monitor and a screen geometry where one monitor is higher and further left to another (scroll down to see a screenshot example).

In the lower-right monitor, when opening certain windows in programs like Inkscape, those windows will be created at coordinate that you cannot access with your mouse cursor.

Workaround:

Pre:

  • If not already installed, then install xdotool (easiest way is to use Homebrew)

To find out window ids and geometry:

  • In Terminal, you can use:
    xwininfo -tree -root
  • If you want to filter by an application, you can pipe to grep, for example:
    xwininfo -tree -root | grep "inkscape"

To move a window to a visible coordinate:

  • If not already installed, then install xdotool (easiest way is to use Homebrew)
  • Make note of a valid coordinate. Use the output of xwininfo from the above step to find a visible top-left coordinate for your window (e.g. it can be an existing window that you can already see and use with your mouse. In the screenshot below, a visible coordinate is 1070 1102)
  • In Terminal, use the following command and replace [options] [window] [x] [y] with the appropriate values:
    xdotool windowmove [options] [window] [x] [y]

Example:

Consider the following window geometry:

Inkscape has spawned the "document properties" window to a coordinate that is out of desktop 1:

Use xwininfo to find out window IDs, geometry, as well as to to find a set of on-screen coordinates:

Use xdotool to move off-screen window to an on-screen coordinate on desktop 1:

If all goes well, the window should now be visible.

Now would be a good time to save your work.

Also note that there might be some unexpected behaviour for XQuartz windows moved this way (e.g. "show all windows" still shows incorrect placement, etc.)

Where to go from here?

Some ideas:

  • write a script to automatically collect all windows of a certain app into visible coordinates if they're not visible
  • if you're able to and have the time to volunteer, contribute to the XQuartz project a feature to collect or clamp all windows to a given desktop :) (thanks in advance!)

Notes:

This workaround was verified to work with macOS Sierra 10.12.6, XQuartz 2.7.11, xdotool 3.20160805.1. Other versions may have different results.

References:

Monday, 28 October 2013

How to run Inkscape in OS X 10.9 Mavericks

Problem:

After upgrading to OS X 10.9, Inkscape, as well as other X11 apps do not seem to work any longer. How can I run Inkscape?

Solution:

  • Install Inkscape (if haven't done so already) from http://inkscape.org/
  • Install XQuartz from http://xquartz.macosforge.org/landing/
  • Run Inkscape.app
  • When asked for "Where is X11?", click "browse ..." and select /Applications/Utilities/XQuartz.app (or just /Applications/Utilities/XQuartz)

Explanation:

As of OS X Mountain Lion, Apple no longer installs the X11.app by default, which was previously needed to run any X11 applications. XQuartz or another compatible X Server is now needed to run any X11 apps as a result. A full explanation can be found in the Apple knowledge base article here: http://support.apple.com/kb/HT5293

Additional comments:

This solution was tested to work with the default installation of OS X 10.9 and Inkscape 0.48.2.

Note that if XQuartz starts up when launching Inkscape, but Inkscape doesn't launch the first time along with XQuartz, (or the Inkscape window doesn't show up), you can try to quit both Inkscape and XQuartz, then launch Inkscape once more (which should also launch XQuartz). This bug occurred on the system that the above fix was tested on, and the workaround seems to have worked. Your mileage might vary.

Addendum:

(Added in 2014)

A useful post from commenter @Birtanish below seems to have helped a few people when the above instructions weren't sufficient, so it's reproduced below in case it helps. Best of luck!:

"Hi! I tried the above solution which in the end did not work at all unfortunately. Another solution is to launch Inkscape from within XQuartz, this is done by opening a terminal and type: open /Applications/Inkscape.app Additionally it is possible to create a shortcut for this in the XQuartz menu, by clicking on Applications -> Customize and the above command as the command and set name to Inkscape for instance. This worked for me, hope it can help somebody else as well. Good luck."

Wednesday, 21 August 2013

Inkscape 0.48.x OS X extensions problem workaround

Problem:

When using extensions with Inkscape 0.48.2 in OS X I get an error similar to: "the fantastic lxml wrapper for libxml2 is required ..." and extensions won't work.

Prerequisites:

This workaround worked on the system it was used on, however the solution is potentially version specific. The versions of stuff installed on this system were:

  • OS X 10.7.5 with the installation of Python that came with it
  • Python 2.7.5 (you can find your version in the terminal by typing "python --version")
  • Fresh install of Inkscape 0.48.2
  • XCode (required to compile the modules that we're going to install)

Notes:

The following steps are not necessarily a permanent fix for this problem, however they worked on the system that they was tested on. Your mileage may vary as the problem seems to be version-specific. Make sure you know what you're doing and follow the instructions at your own risk. If you're unsure, refer to the links in the references for a more complete explanation before starting. Good luck!

Workaround:

This problem is caused by the OS X version of Inkscape not being able to find the version-specific Python module for libxml2 that it was compiled/packaged to use. OS X comes with its own version of python which happens to be missing a few things usually installed in other operating systems. To install the required modules for Inkscape extensions to work, the following steps were taken (though not all may be required for this workaround to succeed.)

This workaround is a combination of two solutions found on internet forums. One of them modifies Inkscape to use version 2.6 of python if it's on the system. (If it is, that modification can be done without installing the libxml modules). The other installs the libxml2 module Inkscape is looking for in version 2.7 of python.

If you're not comfortable with using the terminal, there's an unofficial patch you can install instead of using the below workaround. It can be found at this forum thread: http://boardgamegeek.com/thread/769281/installing-on-osx-lion-the-fantastic-lxml-wrapper (just search for "EggBot2.2.2.r2.mpkg.zip")

Caution: do not proceed if you are not comfortable with the Terminal, command line, or code editing

  • Make sure your install of Inkscape is a fresh, unmodified copy
  • Make sure your python 2 version is at least 2.7.5 (as this workaround was only tested with that version) If it's older, you can get 2.7.5 here: http://www.python.org/download/
  • Open Terminal
  • The following steps may produce errors. If they do, look at the errors and try to fix them to complete the steps before moving on! (The usual: Google if unsure, or do not proceed further)
  • Type the command "sudo easy_install pip" to install the python package manager pip
  • Type the command "sudo pip install virtualenv" (probably not required, but useful)
  • Type the command "sudo pip install lxml"
  • If there are no errors in the above few steps, you're good so far. If there are any errors, try to get the steps to complete without errors (the usual: look at the errors, Google a solution, etc.)
  • In a text editor, open the file "/Applications/Inkscape.app/Contents/Resources/bin/inkscape"
  • Above the line 32 (which reads: "export VERSIONER_PYTHON_PREFER_32_BIT=yes"), add the following line without quotes and save the modified file: "export VERSIONER_PYTHON_VERSION=2.6"
  • (Note that the python version 2.6 specification in the inkscape file may not do anything if version 2.6 isn't on the system, and inkscape may just default to the system's version of python. The above steps to install lxml should make libxml work on the current version of python nonetheless.)
  • Restart Inkscape. The extensions menu should work now.

References:

Thursday, 29 March 2012

Workaround for copy & paste with Inkscape in OS X

There is a bug in OS X with X11 that affects copy and paste between X11 windows when using Inkscape. Basically, vector snippets that are copied in one window paste in another as bitmap rather than vector.

Solution (workaround):

Go into the X11 preferences (click on X11 icon in your dock, then in the menu bar X11->preferences...), and go to the tab that says pasteboard and uncheck: Update Pasteboard when CLIPBOARD changes.