mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-31 11:49:58 -04:00
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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user