lyx2lyx: fix convert_chunks for empty chunk layouts

Fixes: #9298
Add a script to automatically generate SVG math images from a LyX template.

This is an adaptation of Georg's generate_symbols_images script, but it uses dvisvgm instead of dvipng.
A waggonload of SVG math icons.

These are automatically generated via the generate_symbols_svg script. Some were modified manually afterwards.

These certainly need some manual care, and a number of icons are missing (cannot be created automatically). But it is a start.
Icon polishing
Complete math SVG icons
Remove line in text export of inline math (#9282)

If there is only one row, a new line should not be appended. If
there is more than one row, the new line should not be appended for
the last row.

For example, if in LyX there was "as you can see in $x$ there..." a
copy/paste would lead to a newline after "x".
No space after inline math for text export (#9282)

This extra space was the result of the fix for #6094
(at 7e624928).
SVG math icon polishing
Polishing
Fix ticket #9224: text overflows through adjacent insets

The logic of Row::shortenIfNeeded is completely changed to look at the row from the start and not the end. This leads to clearer code.
Erase correctly math multi-cell selection

What a selection spans several cells in mathed, and a deletion occurs though LFUN_CHAR_DELETE_FORWARD for example, only the case of a proper grid was handled. When no such grid exists, all cells between the first and the last index are cleared now.
Fix bug #9296. The key may be multiple keys.
Update comment.
#9130 Text in main work area isn't rendered with high resolution
Introduce the concept of pixel ratio: the ratio of physical and device independent pixels.
This is useful for rendering of content on Retina-displays of Mac hardware with high resolution.
Qt has real support for this starting with Qt5 - therefore it has to be compiled conditionally.
This change uses some work of Marcelo Galvão Póvoa, thank you.
#9130 Text in main work area isn't rendered with high resolution
Add search mode check_hidpi to ease the lookup for images with double size to use for displays with high resolution.
#9130 Text in main work area isn't rendered with high resolution
Add pixel_ratio to graphics params to use it for displays with high resolution.
It holds the ratio between physical pixels and device-independent pixels of the graphics.
 #9130 Text in main work area isn't rendered with high resolution
Add display_pixel_ratio to buffer params to use it for displays with high resolution.
It holds the highest ratio between physical pixels and device-independent pixels of the LyX application.
Preview snippets will be generated using this value to get high resolution preview.
#9130 Text in main work area isn't rendered with high resolution
Assign the pixel_ratio of graphics params to the Qt pixmap of the image.
#9130 Text in main work area isn't rendered with high resolution
Make QT_VERSION check for Qt5 matching Qt5.0.0 too.
#9130 Text in main work area isn't rendered with high resolution
Load images with search mode check_hidpi to read images with double size when present.