Don’t allow <text> elements in letter logos

To render text in an SVG consistently the system rendering the SVG must
have the fonts specified by the SVG installed.

If the fonts are not installed then the renderer will fall back to a
system font and the text will look different. This is especially bad
news for branding where the right font is an integral part of any brand.

To fix this, the text should instead be converted to `<path>` elements.
This process is sometimes called ‘outlining’.

A few of our logos had this problem, and I’ve fixed most of them by
hand. Adding this validation will stop the problem, coming up again.
This commit is contained in:
Chris Hill-Scott
2022-01-06 11:21:12 +00:00
parent 5558af2527
commit 291906e9fd
3 changed files with 16 additions and 1 deletions

View File

@@ -102,6 +102,11 @@ class NoEmbeddedImagesInSVG(NoElementInSVG):
message = 'This SVG has an embedded raster image in it and will not render well'
class NoTextInSVG(NoElementInSVG):
element = 'text'
message = 'This SVG has text which has not been converted to paths and may not render well'
class OnlySMSCharacters:
def __init__(self, *args, template_type, **kwargs):