SVG Font Inkscape two not connected path as one glyph - inkscape

Can anyone tell me, why I can't use not connected paths as one glyph? e.g. I selected 2 stars and wanted to make them as one glyphe, but Inkscape just use the first selected one.

Maybe you are looking for the combine operation (CTRL-K) which will make a single path out of two. Should do what you expect if they are not overlapping, else try the path union (CTRL-+)

Related

Kate Text Editor regexp for CNC code alteration on PC

When using some CAM software, the CNC code is usually generated properly with spaces.
But for example when moved to "Citizen Cincom L20" machine via USB or network and edited there it lose spaces and also lose semicolons while preserving new lines which does work as semicolons anyway.
But since editing of CNC program happens in 3 places: CAM Software(ESPRIT in this case), CNC machine controller and also via text editor on the computer as postprocessor in ESPRIT is garbage.I've come up with this regex
([0-9]{1,2})([A-Z])
\1 \2
so
G1G99X5.4Z-.5F.12
Becomes
G1 G99 X5.4 Z-.5 F.12
that works in Kate to space everything back again for clearer reviwing of code. The only issue about it is that I need to do that manually for every file and I would like to automate it, preferably via Kate, so it would happen upon opening any ????.PRG plain text files.
But I do not exactly know how such happening should be called is it like macro or what ?
I'm looking for some suggestions to accomplish this. Or maybe some alternative solutions
First, go to View -> Tool Views -> Show Search and Replace. You will see
Make sure you:
Enable {} regex option on the right as you are using a regex
Enable "AB" option on the right that enables case sensitive matching
Select In Folder value from the dropdown on the right
Fill out the regex, replacement, Folder and the Filter fields with the appropriate values
Click Search button.
You will see the results in a separate pane and Replace / Replace Checked buttons will become enabled.
Review the replacements and click Replace Checked:
Then you may check the updated file contents, and if you are satisifed with the results, use Save All, also by pressing CTRL+L.

How to 'difference' one vector from another?

I'm trying to create a mute music button:
And I'm doing it by drawing 2 vector lines over a music note vector. I've tried selecting them every which way but whenever I try to take the path → difference nothing happens. Ideally I'd like to subtract the big like (white in the above image) and add the small line.
How would I do this?
Got it. You have to be in the edit paths mode:
You may also need to convert the object into a path. Path → Object to Path

How to get paper.print() to work?

I have been trying to get the following Raphael code to just write something on the screen with no luck!
paper.print(30, 15, "TEXT", paper.getFont("Arial"), 20).attr({fill: "black"});
Is there anything else you need to do to get the text in the paper?!?!!?
You need to cufonize a font, being sure to indicate that the cufonized font should register itself with Raphael, and include the resulting .js file before you can use getFont to retrieve it (there are no fonts available by default). If you check, I'm reasonably sure you'll find that paper.getFont("Arial") is returning undefined.
Cufon essentially converts every glyph in a provided font into its vector equivalent -- Raphael simply transforms and sequences those paths to produce output.

xsl:fo - Add "z-index" to a text on top of an image

I have a problem.
I need to set some kind of z-index, like you can use on the web in HTML/CSS.
Because I have a text on an image, and therefore I want to be sure that it looks good when printing.
Is there some "z-index" code I can use on theese fo:block elements?
Thanks!
/Daniel
XSL-FO defines z-index property:
http://www.w3.org/TR/2001/REC-xsl-20011015/slice7.html#z-index
You have to check your formatting agent whether does support this property.

Get a font filename based on Font Name and Style (Bold/Italic)

This has been driving me crazy all day.
I need to get a font filename (eg. Arial.ttf) based on its name (Arial in this case) and whether it is bold, italic or both. Using those pieces of information, I need to find the font file so I can use it for rendering.
Some more examples:
Calibri, Bold would resolve to calibrib.ttf.
Calibri, Italic would resolve to calibrii.ttf.
Any ideas on how I could achieve this in C++ (Win32)
First, to my knowledge, there is no reliable way to do that.
The Windows API deals with font families and mappings, not with font files, which are dealt with at a lower level. Also note that even if you manage to get the file name of a font, no rendering function (that I know of) will accept it, so what will you do with it?
That said, you can look in the registry key HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Fonts in order to obtain the file name of a font from its logical name. An implementation of that solution can be found here.
Related to the earlier posts, this seems to be a reliable way:
1) Read the registered Windows font list from
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Fonts\
You will obtain file names and alternate file paths here.
The Font names are not useful as they can change with user's locale.
2) Load the TrueType files (.ttf, .ttc, .otf):
Use FreeType https://www.freetype.org/). Just initialize the freetype library and load face with FT_New_Face(library, path, 0, &face).
3) Obtain the font Family name using FreeType.
Use FT_Get_Sfnt_Name_Count() and FT_Get_Sfnt_Name() to obtain the string table.
You will need to check if the encoding is Ansi, UTF16 or other, as some strings will be in multiple different languages and encodings.
4) Obtain the OS2 TrueType properties.
Use (TT_OS2 *) FT_Get_Sfnt_Table (face, ft_sfnt_os2) to get the OS2 structure.
Interpret the structure using docs like https://www.microsoft.com/typography/otspec/os2.htm#fc
5) Now you have font file path, family name, style properties and other information. Build a list of these and function to search for a file based on font family and style.
This Code Project project does what you want. As-is it fails on Windows 7 because the GetWinVer function stops at XP. It is trivial to add the case for Windows 7.
You normally do this by calling CreateFontIndirect and then getting the system to render. Perhaps you could explain why you can't use this standard approach.
One solution would be to access the font files and extract the name from the name table to create your own lookup (an STL map would be a simple way of doing that). Details of the TTF file format can be found here.