Konstantin Zakablukovsky 9 лет назад
Родитель
Сommit
12713282dd

+ 10 - 1
include/nitro.hrl

@@ -247,9 +247,18 @@
 -record(font_face_src, {?ELEMENT_BASE(element_fontfacesrc), ?SVG_CORE}).
 -record(font_face_uri, {?ELEMENT_BASE(element_fontfaceuri), ?SVG_CORE, ?SVG_XLINK}).
 -record(foreignObject, {?ELEMENT_BASE(element_foreignobject), x, y, width, height, transform, externalResourcesRequired, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_GRAPHICAL_EVENT, ?SVG_PRESENTATION}).
+-record(g, {?ELEMENT_BASE(element_g), transform, externalResourcesRequired,  ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_GRAPHICAL_EVENT, ?SVG_PRESENTATION}).
 -record(glyph, {?ELEMENT_BASE(element_glyph), d, horiz_adv_x, vert_origin_x, vert_origin_y, vert_adv_y, unicode, glyph_name, orientation, arabic_form, ?SVG_CORE, ?SVG_PRESENTATION}).
 -record(glyphRef, {?ELEMENT_BASE(element_glyphref), x, y, dx, dy, glyphRef, format, ?SVG_CORE, ?SVG_PRESENTATION, ?SVG_XLINK}).
--record(g, {?ELEMENT_BASE(element_g), transform, externalResourcesRequired,  ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_GRAPHICAL_EVENT, ?SVG_PRESENTATION}).
+-record(hkern, {?ELEMENT_BASE(element_hkern), u1, g1, u2, g2, k, ?SVG_CORE}).
+-record(svgimage, {?ELEMENT_BASE(element_svgimage), x, y, width, height, preserveAspectRatio, transform, externalResourcesRequired, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_GRAPHICAL_EVENT, ?SVG_PRESENTATION, ?SVG_XLINK}).
+-record(line, {?ELEMENT_BASE(element_line), x1, y1, x2, y2, transform, externalResourcesRequired, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_GRAPHICAL_EVENT, ?SVG_PRESENTATION}).
+-record(linearGradient, {?ELEMENT_BASE(element_lineargradient), gradientUnits, gradientTransform, x1, y1, x2, y2, spreadMethod, externalResourcesRequired, ?SVG_CORE, ?SVG_PRESENTATION, ?SVG_XLINK}).
+-record(marker, {?ELEMENT_BASE(element_marker), markerUnits, refX, refY, markerWidth, markerHeight, orient, viewBox, preserveAspectRatio, transform, externalResourcesRequired, ?SVG_CORE, ?SVG_PRESENTATION}).
+-record(mask, {?ELEMENT_BASE(element_mask), maskUnits, maskContentUnits, x, y, width, height, externalResourcesRequired, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_PRESENTATION}).
+-record(metadata, {?ELEMENT_BASE(element_metadata), ?SVG_CORE}).
+-record(missing_glyph, {?ELEMENT_BASE(element_missingglyph), d, horiz_adv_x, vert_origin_x, vert_origin_y, vert_adv_y, ?SVG_CORE, ?SVG_PRESENTATION}).
+-record(mpath, {?ELEMENT_BASE(element_mpath), externalResourcesRequired, ?SVG_CORE, ?SVG_XLINK}).
 -record(path, {?ELEMENT_BASE(element_path), d, pathLength, transform, externalResourcesRequired,  ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_GRAPHICAL_EVENT, ?SVG_PRESENTATION}).
 -record(rect, {?ELEMENT_BASE(element_rect), x, y, width, height, rx, ry, transform, externalResourcesRequired, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_GRAPHICAL_EVENT, ?SVG_PRESENTATION}).
 -record(text, {?ELEMENT_BASE(element_text), x, y, dx, dy, rotate, textLength, lengthAdjust, transform, externalResourcesRequired, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_GRAPHICAL_EVENT, ?SVG_PRESENTATION}).

+ 30 - 0
src/elements/element_hkern.erl

@@ -0,0 +1,30 @@
+-module(element_hkern).
+-author('Konstantin Zakablukovsky').
+-include("nitro.hrl").
+-compile(export_all).
+
+render_element(Record) ->
+	wf_tags:emit_tag(<<"hkern">>, nitro:render(Record#hkern.body),
+	lists:append([
+		[
+			{<<"id">>, Record#hkern.id},
+			{<<"class">>, Record#hkern.class},
+			{<<"style">>, Record#hkern.style},
+			{<<"u1">>, Record#hkern.u1},
+			{<<"g1">>, Record#hkern.g1},
+			{<<"u2">>, Record#hkern.u2},
+			{<<"g2">>, Record#hkern.g2},
+			{<<"k">>, Record#hkern.k}
+		],
+		svg_core(Record),
+		Record#hkern.data_fields,
+		Record#hkern.aria_states
+	])).
+
+
+%% Common SVG attributes
+svg_core(Record)-> [
+	{<<"xml:base">>, Record#hkern.xmlbase},
+	{<<"xml:lang">>, Record#hkern.xmllang},
+	{<<"xml:space">>, Record#hkern.xmlspace}
+].

+ 115 - 0
src/elements/element_line.erl

@@ -0,0 +1,115 @@
+-module(element_line).
+-author('Konstantin Zakablukovsky').
+-include("nitro.hrl").
+-compile(export_all).
+
+render_element(Record) ->
+	wf_tags:emit_tag(<<"line">>, nitro:render(Record#line.body),
+	lists:append([
+		[
+			{<<"id">>, Record#line.id},
+			{<<"class">>, Record#line.class},
+			{<<"style">>, Record#line.style},
+			{<<"x1">>, Record#line.x1},
+			{<<"x2">>, Record#line.x2},
+			{<<"y1">>, Record#line.y1},
+			{<<"y2">>, Record#line.y2},
+			{<<"transform">>, Record#line.transform},
+			{<<"externalResourcesRequired">>, Record#line.externalResourcesRequired}
+		],
+		svg_conditional_processing(Record),
+		svg_core(Record),
+		svg_graphical_event(Record),
+		svg_presentation(Record),
+		Record#line.data_fields,
+		Record#line.aria_states
+	])).
+
+
+%% Common SVG attributes
+svg_conditional_processing(Record)-> [
+	{<<"requiredExtensions">>, Record#line.requiredExtensions},
+	{<<"requiredFeatures">>, Record#line.requiredFeatures},
+	{<<"systemLanguage">>, Record#line.systemLanguage}
+].
+
+svg_core(Record)-> [
+	{<<"xml:base">>, Record#line.xmlbase},
+	{<<"xml:lang">>, Record#line.xmllang},
+	{<<"xml:space">>, Record#line.xmlspace}
+].
+
+svg_graphical_event(Record)-> [
+	{<<"onactivate">>, Record#line.onactivate},
+	{<<"onclick">>, Record#line.onclick},
+	{<<"onfocusin">>, Record#line.onfocusin},
+	{<<"onfocusout">>, Record#line.onfocusout},
+	{<<"onload">>, Record#line.onload_graphical},
+	{<<"onmousedown">>, Record#line.onmousedown},
+	{<<"onmousemove">>, Record#line.onmousemove},
+	{<<"onmouseout">>, Record#line.onmouseout},
+	{<<"onmouseover">>, Record#line.onmouseover},
+	{<<"onmouseup">>, Record#line.onmouseup}
+].
+
+svg_presentation(Record)-> [
+	{<<"alignment-baseline">>, Record#line.alignment_baseline},
+	{<<"baseline-shift">>, Record#line.baseline_shift},
+	{<<"clip">>, Record#line.clip},
+	{<<"clip-path">>, Record#line.clip_path},
+	{<<"clip-rule">>, Record#line.clip_rule},
+	{<<"color">>, Record#line.color},
+	{<<"color-interpolation">>, Record#line.color_interpolation},
+	{<<"color-interpolation-filters">>, Record#line.color_interpolation_filters},
+	{<<"color-profile">>, Record#line.color_profile},
+	{<<"color-rendering">>, Record#line.color_rendering},
+	{<<"cursor">>, Record#line.cursor},
+	{<<"direction">>, Record#line.direction},
+	{<<"display">>, Record#line.display},
+	{<<"dominant-baseline">>, Record#line.dominant_baseline},
+	{<<"enable-background">>, Record#line.enable_background},
+	{<<"fill">>, Record#line.fill},
+	{<<"fill-opacity">>, Record#line.fill_opacity},
+	{<<"fill-rule">>, Record#line.fill_rule},
+	{<<"filter">>, Record#line.filter},
+	{<<"flood-color">>, Record#line.flood_color},
+	{<<"flood-opacity">>, Record#line.flood_opacity},
+	{<<"font-family">>, Record#line.font_family},
+	{<<"font-size">>, Record#line.font_size},
+	{<<"font-size-adjust">>, Record#line.font_size_adjust},
+	{<<"font-stretch">>, Record#line.font_stretch},
+	{<<"font-style">>, Record#line.font_style},
+	{<<"font-variant">>, Record#line.font_variant},
+	{<<"font-weight">>, Record#line.font_weight},
+	{<<"glyph-orientation-horizontal">>, Record#line.glyph_orientation_horizontal},
+	{<<"glyph-orientation-vertical">>, Record#line.glyph_orientation_vertical},
+	{<<"image-rendering">>, Record#line.image_rendering},
+	{<<"kerning">>, Record#line.kerning},
+	{<<"letter-spacing">>, Record#line.letter_spacing},
+	{<<"lighting-color">>, Record#line.lighting_color},
+	{<<"marker-end">>, Record#line.marker_end},
+	{<<"marker-mid">>, Record#line.marker_mid},
+	{<<"marker-start">>, Record#line.marker_start},
+	{<<"mask">>, Record#line.mask},
+	{<<"opacity">>, Record#line.opacity},
+	{<<"overflow">>, Record#line.overflow},
+	{<<"pointer-events">>, Record#line.pointer_events},
+	{<<"shape-rendering">>, Record#line.shape_rendering},
+	{<<"stop-color">>, Record#line.stop_color},
+	{<<"stop-opacity">>, Record#line.stop_opacity},
+	{<<"stroke">>, Record#line.stroke},
+	{<<"stroke-dasharray">>, Record#line.stroke_dasharray},
+	{<<"stroke-dashoffset">>, Record#line.stroke_dashoffset},
+	{<<"stroke-linecap">>, Record#line.stroke_linecap},
+	{<<"stroke-linejoin">>, Record#line.stroke_linejoin},
+	{<<"stroke-miterlimit">>, Record#line.stroke_miterlimit},
+	{<<"stroke-opacity">>, Record#line.stroke_opacity},
+	{<<"stroke-width">>, Record#line.stroke_width},
+	{<<"text-anchor">>, Record#line.text_anchor},
+	{<<"text-decoration">>, Record#line.text_decoration},
+	{<<"text-rendering">>, Record#line.text_rendering},
+	{<<"unicode-bidi">>, Record#line.unicode_bidi},
+	{<<"visibility">>, Record#line.visibility},
+	{<<"word-spacing">>, Record#line.word_spacing},
+	{<<"writing-mode">>, Record#line.writing_mode}
+].

+ 107 - 0
src/elements/element_lineargradient.erl

@@ -0,0 +1,107 @@
+-module(element_lineargradient).
+-author('Konstantin Zakablukovsky').
+-include("nitro.hrl").
+-compile(export_all).
+
+render_element(Record) ->
+	wf_tags:emit_tag(<<"linearGradient">>, nitro:render(Record#linearGradient.body),
+	lists:append([
+		[
+			{<<"id">>, Record#linearGradient.id},
+			{<<"class">>, Record#linearGradient.class},
+			{<<"style">>, Record#linearGradient.style},
+			{<<"gradientUnits">>, Record#linearGradient.gradientUnits},
+			{<<"gradientTransform">>, Record#linearGradient.gradientTransform},
+			{<<"x1">>, Record#linearGradient.x1},
+			{<<"x2">>, Record#linearGradient.x2},
+			{<<"y1">>, Record#linearGradient.y1},
+			{<<"y2">>, Record#linearGradient.y2},
+			{<<"spreadMethod">>, Record#linearGradient.spreadMethod},
+			{<<"externalResourcesRequired">>, Record#linearGradient.externalResourcesRequired}
+		],
+		svg_core(Record),
+		svg_presentation(Record),
+		svg_xlink(Record),
+		Record#linearGradient.data_fields,
+		Record#linearGradient.aria_states
+	])).
+
+
+%% Common SVG attributes
+svg_core(Record)-> [
+	{<<"xml:base">>, Record#linearGradient.xmlbase},
+	{<<"xml:lang">>, Record#linearGradient.xmllang},
+	{<<"xml:space">>, Record#linearGradient.xmlspace}
+].
+
+svg_presentation(Record)-> [
+	{<<"alignment-baseline">>, Record#linearGradient.alignment_baseline},
+	{<<"baseline-shift">>, Record#linearGradient.baseline_shift},
+	{<<"clip">>, Record#linearGradient.clip},
+	{<<"clip-path">>, Record#linearGradient.clip_path},
+	{<<"clip-rule">>, Record#linearGradient.clip_rule},
+	{<<"color">>, Record#linearGradient.color},
+	{<<"color-interpolation">>, Record#linearGradient.color_interpolation},
+	{<<"color-interpolation-filters">>, Record#linearGradient.color_interpolation_filters},
+	{<<"color-profile">>, Record#linearGradient.color_profile},
+	{<<"color-rendering">>, Record#linearGradient.color_rendering},
+	{<<"cursor">>, Record#linearGradient.cursor},
+	{<<"direction">>, Record#linearGradient.direction},
+	{<<"display">>, Record#linearGradient.display},
+	{<<"dominant-baseline">>, Record#linearGradient.dominant_baseline},
+	{<<"enable-background">>, Record#linearGradient.enable_background},
+	{<<"fill">>, Record#linearGradient.fill},
+	{<<"fill-opacity">>, Record#linearGradient.fill_opacity},
+	{<<"fill-rule">>, Record#linearGradient.fill_rule},
+	{<<"filter">>, Record#linearGradient.filter},
+	{<<"flood-color">>, Record#linearGradient.flood_color},
+	{<<"flood-opacity">>, Record#linearGradient.flood_opacity},
+	{<<"font-family">>, Record#linearGradient.font_family},
+	{<<"font-size">>, Record#linearGradient.font_size},
+	{<<"font-size-adjust">>, Record#linearGradient.font_size_adjust},
+	{<<"font-stretch">>, Record#linearGradient.font_stretch},
+	{<<"font-style">>, Record#linearGradient.font_style},
+	{<<"font-variant">>, Record#linearGradient.font_variant},
+	{<<"font-weight">>, Record#linearGradient.font_weight},
+	{<<"glyph-orientation-horizontal">>, Record#linearGradient.glyph_orientation_horizontal},
+	{<<"glyph-orientation-vertical">>, Record#linearGradient.glyph_orientation_vertical},
+	{<<"image-rendering">>, Record#linearGradient.image_rendering},
+	{<<"kerning">>, Record#linearGradient.kerning},
+	{<<"letter-spacing">>, Record#linearGradient.letter_spacing},
+	{<<"lighting-color">>, Record#linearGradient.lighting_color},
+	{<<"marker-end">>, Record#linearGradient.marker_end},
+	{<<"marker-mid">>, Record#linearGradient.marker_mid},
+	{<<"marker-start">>, Record#linearGradient.marker_start},
+	{<<"mask">>, Record#linearGradient.mask},
+	{<<"opacity">>, Record#linearGradient.opacity},
+	{<<"overflow">>, Record#linearGradient.overflow},
+	{<<"pointer-events">>, Record#linearGradient.pointer_events},
+	{<<"shape-rendering">>, Record#linearGradient.shape_rendering},
+	{<<"stop-color">>, Record#linearGradient.stop_color},
+	{<<"stop-opacity">>, Record#linearGradient.stop_opacity},
+	{<<"stroke">>, Record#linearGradient.stroke},
+	{<<"stroke-dasharray">>, Record#linearGradient.stroke_dasharray},
+	{<<"stroke-dashoffset">>, Record#linearGradient.stroke_dashoffset},
+	{<<"stroke-linecap">>, Record#linearGradient.stroke_linecap},
+	{<<"stroke-linejoin">>, Record#linearGradient.stroke_linejoin},
+	{<<"stroke-miterlimit">>, Record#linearGradient.stroke_miterlimit},
+	{<<"stroke-opacity">>, Record#linearGradient.stroke_opacity},
+	{<<"stroke-width">>, Record#linearGradient.stroke_width},
+	{<<"text-anchor">>, Record#linearGradient.text_anchor},
+	{<<"text-decoration">>, Record#linearGradient.text_decoration},
+	{<<"text-rendering">>, Record#linearGradient.text_rendering},
+	{<<"unicode-bidi">>, Record#linearGradient.unicode_bidi},
+	{<<"visibility">>, Record#linearGradient.visibility},
+	{<<"word-spacing">>, Record#linearGradient.word_spacing},
+	{<<"writing-mode">>, Record#linearGradient.writing_mode}
+].
+
+svg_xlink(Record)-> [
+	{<<"xlink:href">>, Record#linearGradient.xlinkhref},
+	{<<"xlink:type">>, Record#linearGradient.xlinktype},
+	{<<"xlink:role">>, Record#linearGradient.xlinkrole},
+	{<<"xlink:arcrole">>, Record#linearGradient.xlinkarcrole},
+	{<<"xlink:title">>, Record#linearGradient.xlinktitle},
+	{<<"xlink:show">>, Record#linearGradient.xlinkshow},
+	{<<"xlink:actuate">>, Record#linearGradient.xlinkactuate}
+].

+ 98 - 0
src/elements/element_marker.erl

@@ -0,0 +1,98 @@
+-module(element_marker).
+-author('Konstantin Zakablukovsky').
+-include("nitro.hrl").
+-compile(export_all).
+
+render_element(Record) ->
+	wf_tags:emit_tag(<<"marker">>, nitro:render(Record#marker.body),
+	lists:append([
+		[
+			{<<"id">>, Record#marker.id},
+			{<<"class">>, Record#marker.class},
+			{<<"style">>, Record#marker.style},
+			{<<"markerUnits">>, Record#marker.markerUnits},
+			{<<"refX">>, Record#marker.refX},
+			{<<"refY">>, Record#marker.refY},
+			{<<"markerWidth">>, Record#marker.markerWidth},
+			{<<"markerHeight">>, Record#marker.markerHeight},
+			{<<"orient">>, Record#marker.orient},
+			{<<"viewBox">>, Record#marker.viewBox},
+			{<<"preserveAspectRatio">>, Record#marker.preserveAspectRatio},
+			{<<"transform">>, Record#marker.transform},
+			{<<"externalResourcesRequired">>, Record#marker.externalResourcesRequired}
+		],
+		svg_core(Record),
+		svg_presentation(Record),
+		Record#marker.data_fields,
+		Record#marker.aria_states
+	])).
+
+
+%% Common SVG attributes
+svg_core(Record)-> [
+	{<<"xml:base">>, Record#marker.xmlbase},
+	{<<"xml:lang">>, Record#marker.xmllang},
+	{<<"xml:space">>, Record#marker.xmlspace}
+].
+
+svg_presentation(Record)-> [
+	{<<"alignment-baseline">>, Record#marker.alignment_baseline},
+	{<<"baseline-shift">>, Record#marker.baseline_shift},
+	{<<"clip">>, Record#marker.clip},
+	{<<"clip-path">>, Record#marker.clip_path},
+	{<<"clip-rule">>, Record#marker.clip_rule},
+	{<<"color">>, Record#marker.color},
+	{<<"color-interpolation">>, Record#marker.color_interpolation},
+	{<<"color-interpolation-filters">>, Record#marker.color_interpolation_filters},
+	{<<"color-profile">>, Record#marker.color_profile},
+	{<<"color-rendering">>, Record#marker.color_rendering},
+	{<<"cursor">>, Record#marker.cursor},
+	{<<"direction">>, Record#marker.direction},
+	{<<"display">>, Record#marker.display},
+	{<<"dominant-baseline">>, Record#marker.dominant_baseline},
+	{<<"enable-background">>, Record#marker.enable_background},
+	{<<"fill">>, Record#marker.fill},
+	{<<"fill-opacity">>, Record#marker.fill_opacity},
+	{<<"fill-rule">>, Record#marker.fill_rule},
+	{<<"filter">>, Record#marker.filter},
+	{<<"flood-color">>, Record#marker.flood_color},
+	{<<"flood-opacity">>, Record#marker.flood_opacity},
+	{<<"font-family">>, Record#marker.font_family},
+	{<<"font-size">>, Record#marker.font_size},
+	{<<"font-size-adjust">>, Record#marker.font_size_adjust},
+	{<<"font-stretch">>, Record#marker.font_stretch},
+	{<<"font-style">>, Record#marker.font_style},
+	{<<"font-variant">>, Record#marker.font_variant},
+	{<<"font-weight">>, Record#marker.font_weight},
+	{<<"glyph-orientation-horizontal">>, Record#marker.glyph_orientation_horizontal},
+	{<<"glyph-orientation-vertical">>, Record#marker.glyph_orientation_vertical},
+	{<<"image-rendering">>, Record#marker.image_rendering},
+	{<<"kerning">>, Record#marker.kerning},
+	{<<"letter-spacing">>, Record#marker.letter_spacing},
+	{<<"lighting-color">>, Record#marker.lighting_color},
+	{<<"marker-end">>, Record#marker.marker_end},
+	{<<"marker-mid">>, Record#marker.marker_mid},
+	{<<"marker-start">>, Record#marker.marker_start},
+	{<<"mask">>, Record#marker.mask},
+	{<<"opacity">>, Record#marker.opacity},
+	{<<"overflow">>, Record#marker.overflow},
+	{<<"pointer-events">>, Record#marker.pointer_events},
+	{<<"shape-rendering">>, Record#marker.shape_rendering},
+	{<<"stop-color">>, Record#marker.stop_color},
+	{<<"stop-opacity">>, Record#marker.stop_opacity},
+	{<<"stroke">>, Record#marker.stroke},
+	{<<"stroke-dasharray">>, Record#marker.stroke_dasharray},
+	{<<"stroke-dashoffset">>, Record#marker.stroke_dashoffset},
+	{<<"stroke-linecap">>, Record#marker.stroke_linecap},
+	{<<"stroke-linejoin">>, Record#marker.stroke_linejoin},
+	{<<"stroke-miterlimit">>, Record#marker.stroke_miterlimit},
+	{<<"stroke-opacity">>, Record#marker.stroke_opacity},
+	{<<"stroke-width">>, Record#marker.stroke_width},
+	{<<"text-anchor">>, Record#marker.text_anchor},
+	{<<"text-decoration">>, Record#marker.text_decoration},
+	{<<"text-rendering">>, Record#marker.text_rendering},
+	{<<"unicode-bidi">>, Record#marker.unicode_bidi},
+	{<<"visibility">>, Record#marker.visibility},
+	{<<"word-spacing">>, Record#marker.word_spacing},
+	{<<"writing-mode">>, Record#marker.writing_mode}
+].

+ 102 - 0
src/elements/element_mask.erl

@@ -0,0 +1,102 @@
+-module(element_mask).
+-author('Konstantin Zakablukovsky').
+-include("nitro.hrl").
+-compile(export_all).
+
+render_element(Record) ->
+	wf_tags:emit_tag(<<"mask">>, nitro:render(Record#mask.body),
+	lists:append([
+		[
+			{<<"id">>, Record#mask.id},
+			{<<"class">>, Record#mask.class},
+			{<<"style">>, Record#mask.style},
+			{<<"maskUnits">>, Record#mask.maskUnits},
+			{<<"maskContentUnits">>, Record#mask.maskContentUnits},
+			{<<"x">>, Record#mask.x},
+			{<<"y">>, Record#mask.y},
+			{<<"width">>, Record#mask.width},
+			{<<"height">>, Record#mask.height},
+			{<<"externalResourcesRequired">>, Record#mask.externalResourcesRequired}
+		],
+		svg_conditional_processing(Record),
+		svg_core(Record),
+		svg_presentation(Record),
+		Record#mask.data_fields,
+		Record#mask.aria_states
+	])).
+
+
+%% Common SVG attributes
+svg_conditional_processing(Record)-> [
+	{<<"requiredExtensions">>, Record#mask.requiredExtensions},
+	{<<"requiredFeatures">>, Record#mask.requiredFeatures},
+	{<<"systemLanguage">>, Record#mask.systemLanguage}
+].
+
+svg_core(Record)-> [
+	{<<"xml:base">>, Record#mask.xmlbase},
+	{<<"xml:lang">>, Record#mask.xmllang},
+	{<<"xml:space">>, Record#mask.xmlspace}
+].
+
+svg_presentation(Record)-> [
+	{<<"alignment-baseline">>, Record#mask.alignment_baseline},
+	{<<"baseline-shift">>, Record#mask.baseline_shift},
+	{<<"clip">>, Record#mask.clip},
+	{<<"clip-path">>, Record#mask.clip_path},
+	{<<"clip-rule">>, Record#mask.clip_rule},
+	{<<"color">>, Record#mask.color},
+	{<<"color-interpolation">>, Record#mask.color_interpolation},
+	{<<"color-interpolation-filters">>, Record#mask.color_interpolation_filters},
+	{<<"color-profile">>, Record#mask.color_profile},
+	{<<"color-rendering">>, Record#mask.color_rendering},
+	{<<"cursor">>, Record#mask.cursor},
+	{<<"direction">>, Record#mask.direction},
+	{<<"display">>, Record#mask.display},
+	{<<"dominant-baseline">>, Record#mask.dominant_baseline},
+	{<<"enable-background">>, Record#mask.enable_background},
+	{<<"fill">>, Record#mask.fill},
+	{<<"fill-opacity">>, Record#mask.fill_opacity},
+	{<<"fill-rule">>, Record#mask.fill_rule},
+	{<<"filter">>, Record#mask.filter},
+	{<<"flood-color">>, Record#mask.flood_color},
+	{<<"flood-opacity">>, Record#mask.flood_opacity},
+	{<<"font-family">>, Record#mask.font_family},
+	{<<"font-size">>, Record#mask.font_size},
+	{<<"font-size-adjust">>, Record#mask.font_size_adjust},
+	{<<"font-stretch">>, Record#mask.font_stretch},
+	{<<"font-style">>, Record#mask.font_style},
+	{<<"font-variant">>, Record#mask.font_variant},
+	{<<"font-weight">>, Record#mask.font_weight},
+	{<<"glyph-orientation-horizontal">>, Record#mask.glyph_orientation_horizontal},
+	{<<"glyph-orientation-vertical">>, Record#mask.glyph_orientation_vertical},
+	{<<"image-rendering">>, Record#mask.image_rendering},
+	{<<"kerning">>, Record#mask.kerning},
+	{<<"letter-spacing">>, Record#mask.letter_spacing},
+	{<<"lighting-color">>, Record#mask.lighting_color},
+	{<<"marker-end">>, Record#mask.marker_end},
+	{<<"marker-mid">>, Record#mask.marker_mid},
+	{<<"marker-start">>, Record#mask.marker_start},
+	{<<"mask">>, Record#mask.mask},
+	{<<"opacity">>, Record#mask.opacity},
+	{<<"overflow">>, Record#mask.overflow},
+	{<<"pointer-events">>, Record#mask.pointer_events},
+	{<<"shape-rendering">>, Record#mask.shape_rendering},
+	{<<"stop-color">>, Record#mask.stop_color},
+	{<<"stop-opacity">>, Record#mask.stop_opacity},
+	{<<"stroke">>, Record#mask.stroke},
+	{<<"stroke-dasharray">>, Record#mask.stroke_dasharray},
+	{<<"stroke-dashoffset">>, Record#mask.stroke_dashoffset},
+	{<<"stroke-linecap">>, Record#mask.stroke_linecap},
+	{<<"stroke-linejoin">>, Record#mask.stroke_linejoin},
+	{<<"stroke-miterlimit">>, Record#mask.stroke_miterlimit},
+	{<<"stroke-opacity">>, Record#mask.stroke_opacity},
+	{<<"stroke-width">>, Record#mask.stroke_width},
+	{<<"text-anchor">>, Record#mask.text_anchor},
+	{<<"text-decoration">>, Record#mask.text_decoration},
+	{<<"text-rendering">>, Record#mask.text_rendering},
+	{<<"unicode-bidi">>, Record#mask.unicode_bidi},
+	{<<"visibility">>, Record#mask.visibility},
+	{<<"word-spacing">>, Record#mask.word_spacing},
+	{<<"writing-mode">>, Record#mask.writing_mode}
+].

+ 25 - 0
src/elements/element_metadata.erl

@@ -0,0 +1,25 @@
+-module(element_metadata).
+-author('Konstantin Zakablukovsky').
+-include("nitro.hrl").
+-compile(export_all).
+
+render_element(Record) ->
+	wf_tags:emit_tag(<<"metadata">>, nitro:render(Record#metadata.body),
+	lists:append([
+		[
+			{<<"id">>, Record#metadata.id},
+			{<<"class">>, Record#metadata.class},
+			{<<"style">>, Record#metadata.style}
+		],
+		svg_core(Record),
+		Record#metadata.data_fields,
+		Record#metadata.aria_states
+	])).
+
+
+%% Common SVG attributes
+svg_core(Record)-> [
+	{<<"xml:base">>, Record#metadata.xmlbase},
+	{<<"xml:lang">>, Record#metadata.xmllang},
+	{<<"xml:space">>, Record#metadata.xmlspace}
+].

+ 93 - 0
src/elements/element_missingglyph.erl

@@ -0,0 +1,93 @@
+-module(element_missingglyph).
+-author('Konstantin Zakablukovsky').
+-include("nitro.hrl").
+-compile(export_all).
+
+render_element(Record) ->
+	wf_tags:emit_tag(<<"missing-glyph">>, nitro:render(Record#missing_glyph.body),
+	lists:append([
+		[
+			{<<"id">>, Record#missing_glyph.id},
+			{<<"class">>, Record#missing_glyph.class},
+			{<<"style">>, Record#missing_glyph.style},
+			{<<"d">>, Record#missing_glyph.d},
+			{<<"horiz-adv-x">>, Record#missing_glyph.horiz_adv_x},
+			{<<"vert-origin-x">>, Record#missing_glyph.vert_origin_x},
+			{<<"vert-origin-y">>, Record#missing_glyph.vert_origin_y},
+			{<<"vert-adv-y">>, Record#missing_glyph.vert_adv_y}
+		],
+		svg_core(Record),
+		svg_presentation(Record),
+		Record#missing_glyph.data_fields,
+		Record#missing_glyph.aria_states
+	])).
+
+
+%% Common SVG attributes
+svg_core(Record)-> [
+	{<<"xml:base">>, Record#missing_glyph.xmlbase},
+	{<<"xml:lang">>, Record#missing_glyph.xmllang},
+	{<<"xml:space">>, Record#missing_glyph.xmlspace}
+].
+
+svg_presentation(Record)-> [
+	{<<"alignment-baseline">>, Record#missing_glyph.alignment_baseline},
+	{<<"baseline-shift">>, Record#missing_glyph.baseline_shift},
+	{<<"clip">>, Record#missing_glyph.clip},
+	{<<"clip-path">>, Record#missing_glyph.clip_path},
+	{<<"clip-rule">>, Record#missing_glyph.clip_rule},
+	{<<"color">>, Record#missing_glyph.color},
+	{<<"color-interpolation">>, Record#missing_glyph.color_interpolation},
+	{<<"color-interpolation-filters">>, Record#missing_glyph.color_interpolation_filters},
+	{<<"color-profile">>, Record#missing_glyph.color_profile},
+	{<<"color-rendering">>, Record#missing_glyph.color_rendering},
+	{<<"cursor">>, Record#missing_glyph.cursor},
+	{<<"direction">>, Record#missing_glyph.direction},
+	{<<"display">>, Record#missing_glyph.display},
+	{<<"dominant-baseline">>, Record#missing_glyph.dominant_baseline},
+	{<<"enable-background">>, Record#missing_glyph.enable_background},
+	{<<"fill">>, Record#missing_glyph.fill},
+	{<<"fill-opacity">>, Record#missing_glyph.fill_opacity},
+	{<<"fill-rule">>, Record#missing_glyph.fill_rule},
+	{<<"filter">>, Record#missing_glyph.filter},
+	{<<"flood-color">>, Record#missing_glyph.flood_color},
+	{<<"flood-opacity">>, Record#missing_glyph.flood_opacity},
+	{<<"font-family">>, Record#missing_glyph.font_family},
+	{<<"font-size">>, Record#missing_glyph.font_size},
+	{<<"font-size-adjust">>, Record#missing_glyph.font_size_adjust},
+	{<<"font-stretch">>, Record#missing_glyph.font_stretch},
+	{<<"font-style">>, Record#missing_glyph.font_style},
+	{<<"font-variant">>, Record#missing_glyph.font_variant},
+	{<<"font-weight">>, Record#missing_glyph.font_weight},
+	{<<"glyph-orientation-horizontal">>, Record#missing_glyph.glyph_orientation_horizontal},
+	{<<"glyph-orientation-vertical">>, Record#missing_glyph.glyph_orientation_vertical},
+	{<<"image-rendering">>, Record#missing_glyph.image_rendering},
+	{<<"kerning">>, Record#missing_glyph.kerning},
+	{<<"letter-spacing">>, Record#missing_glyph.letter_spacing},
+	{<<"lighting-color">>, Record#missing_glyph.lighting_color},
+	{<<"marker-end">>, Record#missing_glyph.marker_end},
+	{<<"marker-mid">>, Record#missing_glyph.marker_mid},
+	{<<"marker-start">>, Record#missing_glyph.marker_start},
+	{<<"mask">>, Record#missing_glyph.mask},
+	{<<"opacity">>, Record#missing_glyph.opacity},
+	{<<"overflow">>, Record#missing_glyph.overflow},
+	{<<"pointer-events">>, Record#missing_glyph.pointer_events},
+	{<<"shape-rendering">>, Record#missing_glyph.shape_rendering},
+	{<<"stop-color">>, Record#missing_glyph.stop_color},
+	{<<"stop-opacity">>, Record#missing_glyph.stop_opacity},
+	{<<"stroke">>, Record#missing_glyph.stroke},
+	{<<"stroke-dasharray">>, Record#missing_glyph.stroke_dasharray},
+	{<<"stroke-dashoffset">>, Record#missing_glyph.stroke_dashoffset},
+	{<<"stroke-linecap">>, Record#missing_glyph.stroke_linecap},
+	{<<"stroke-linejoin">>, Record#missing_glyph.stroke_linejoin},
+	{<<"stroke-miterlimit">>, Record#missing_glyph.stroke_miterlimit},
+	{<<"stroke-opacity">>, Record#missing_glyph.stroke_opacity},
+	{<<"stroke-width">>, Record#missing_glyph.stroke_width},
+	{<<"text-anchor">>, Record#missing_glyph.text_anchor},
+	{<<"text-decoration">>, Record#missing_glyph.text_decoration},
+	{<<"text-rendering">>, Record#missing_glyph.text_rendering},
+	{<<"unicode-bidi">>, Record#missing_glyph.unicode_bidi},
+	{<<"visibility">>, Record#missing_glyph.visibility},
+	{<<"word-spacing">>, Record#missing_glyph.word_spacing},
+	{<<"writing-mode">>, Record#missing_glyph.writing_mode}
+].

+ 37 - 0
src/elements/element_mpath.erl

@@ -0,0 +1,37 @@
+-module(element_mpath).
+-author('Konstantin Zakablukovsky').
+-include("nitro.hrl").
+-compile(export_all).
+
+render_element(Record) ->
+	wf_tags:emit_tag(<<"mpath">>, nitro:render(Record#mpath.body),
+	lists:append([
+		[
+			{<<"id">>, Record#mpath.id},
+			{<<"class">>, Record#mpath.class},
+			{<<"style">>, Record#mpath.style},
+			{<<"externalResourcesRequired">>, Record#mpath.externalResourcesRequired}
+		],
+		svg_core(Record),
+		svg_xlink(Record),
+		Record#mpath.data_fields,
+		Record#mpath.aria_states
+	])).
+
+
+%% Common SVG attributes
+svg_core(Record)-> [
+	{<<"xml:base">>, Record#mpath.xmlbase},
+	{<<"xml:lang">>, Record#mpath.xmllang},
+	{<<"xml:space">>, Record#mpath.xmlspace}
+].
+
+svg_xlink(Record)-> [
+	{<<"xlink:href">>, Record#mpath.xlinkhref},
+	{<<"xlink:type">>, Record#mpath.xlinktype},
+	{<<"xlink:role">>, Record#mpath.xlinkrole},
+	{<<"xlink:arcrole">>, Record#mpath.xlinkarcrole},
+	{<<"xlink:title">>, Record#mpath.xlinktitle},
+	{<<"xlink:show">>, Record#mpath.xlinkshow},
+	{<<"xlink:actuate">>, Record#mpath.xlinkactuate}
+].

+ 127 - 0
src/elements/element_svgimage.erl

@@ -0,0 +1,127 @@
+-module(element_svgimage).
+-author('Konstantin Zakablukovsky').
+-include("nitro.hrl").
+-compile(export_all).
+
+render_element(Record) ->
+	wf_tags:emit_tag(<<"image">>, nitro:render(Record#svgimage.body),
+	lists:append([
+		[
+			{<<"id">>, Record#svgimage.id},
+			{<<"class">>, Record#svgimage.class},
+			{<<"style">>, Record#svgimage.style},
+			{<<"x">>, Record#svgimage.x},
+			{<<"y">>, Record#svgimage.y},
+			{<<"width">>, Record#svgimage.width},
+			{<<"height">>, Record#svgimage.height},
+			{<<"preserveAspectRatio">>, Record#svgimage.preserveAspectRatio},
+			{<<"transform">>, Record#svgimage.transform},
+			{<<"externalResourcesRequired">>, Record#svgimage.externalResourcesRequired}
+		],
+		svg_conditional_processing(Record),
+		svg_core(Record),
+		svg_graphical_event(Record),
+		svg_presentation(Record),
+		svg_xlink(Record),
+		Record#svgimage.data_fields,
+		Record#svgimage.aria_states
+	])).
+
+
+%% Common SVG attributes
+svg_conditional_processing(Record)-> [
+	{<<"requiredExtensions">>, Record#svgimage.requiredExtensions},
+	{<<"requiredFeatures">>, Record#svgimage.requiredFeatures},
+	{<<"systemLanguage">>, Record#svgimage.systemLanguage}
+].
+
+svg_core(Record)-> [
+	{<<"xml:base">>, Record#svgimage.xmlbase},
+	{<<"xml:lang">>, Record#svgimage.xmllang},
+	{<<"xml:space">>, Record#svgimage.xmlspace}
+].
+
+svg_graphical_event(Record)-> [
+	{<<"onactivate">>, Record#svgimage.onactivate},
+	{<<"onclick">>, Record#svgimage.onclick},
+	{<<"onfocusin">>, Record#svgimage.onfocusin},
+	{<<"onfocusout">>, Record#svgimage.onfocusout},
+	{<<"onload">>, Record#svgimage.onload_graphical},
+	{<<"onmousedown">>, Record#svgimage.onmousedown},
+	{<<"onmousemove">>, Record#svgimage.onmousemove},
+	{<<"onmouseout">>, Record#svgimage.onmouseout},
+	{<<"onmouseover">>, Record#svgimage.onmouseover},
+	{<<"onmouseup">>, Record#svgimage.onmouseup}
+].
+
+svg_presentation(Record)-> [
+	{<<"alignment-baseline">>, Record#svgimage.alignment_baseline},
+	{<<"baseline-shift">>, Record#svgimage.baseline_shift},
+	{<<"clip">>, Record#svgimage.clip},
+	{<<"clip-path">>, Record#svgimage.clip_path},
+	{<<"clip-rule">>, Record#svgimage.clip_rule},
+	{<<"color">>, Record#svgimage.color},
+	{<<"color-interpolation">>, Record#svgimage.color_interpolation},
+	{<<"color-interpolation-filters">>, Record#svgimage.color_interpolation_filters},
+	{<<"color-profile">>, Record#svgimage.color_profile},
+	{<<"color-rendering">>, Record#svgimage.color_rendering},
+	{<<"cursor">>, Record#svgimage.cursor},
+	{<<"direction">>, Record#svgimage.direction},
+	{<<"display">>, Record#svgimage.display},
+	{<<"dominant-baseline">>, Record#svgimage.dominant_baseline},
+	{<<"enable-background">>, Record#svgimage.enable_background},
+	{<<"fill">>, Record#svgimage.fill},
+	{<<"fill-opacity">>, Record#svgimage.fill_opacity},
+	{<<"fill-rule">>, Record#svgimage.fill_rule},
+	{<<"filter">>, Record#svgimage.filter},
+	{<<"flood-color">>, Record#svgimage.flood_color},
+	{<<"flood-opacity">>, Record#svgimage.flood_opacity},
+	{<<"font-family">>, Record#svgimage.font_family},
+	{<<"font-size">>, Record#svgimage.font_size},
+	{<<"font-size-adjust">>, Record#svgimage.font_size_adjust},
+	{<<"font-stretch">>, Record#svgimage.font_stretch},
+	{<<"font-style">>, Record#svgimage.font_style},
+	{<<"font-variant">>, Record#svgimage.font_variant},
+	{<<"font-weight">>, Record#svgimage.font_weight},
+	{<<"glyph-orientation-horizontal">>, Record#svgimage.glyph_orientation_horizontal},
+	{<<"glyph-orientation-vertical">>, Record#svgimage.glyph_orientation_vertical},
+	{<<"image-rendering">>, Record#svgimage.image_rendering},
+	{<<"kerning">>, Record#svgimage.kerning},
+	{<<"letter-spacing">>, Record#svgimage.letter_spacing},
+	{<<"lighting-color">>, Record#svgimage.lighting_color},
+	{<<"marker-end">>, Record#svgimage.marker_end},
+	{<<"marker-mid">>, Record#svgimage.marker_mid},
+	{<<"marker-start">>, Record#svgimage.marker_start},
+	{<<"mask">>, Record#svgimage.mask},
+	{<<"opacity">>, Record#svgimage.opacity},
+	{<<"overflow">>, Record#svgimage.overflow},
+	{<<"pointer-events">>, Record#svgimage.pointer_events},
+	{<<"shape-rendering">>, Record#svgimage.shape_rendering},
+	{<<"stop-color">>, Record#svgimage.stop_color},
+	{<<"stop-opacity">>, Record#svgimage.stop_opacity},
+	{<<"stroke">>, Record#svgimage.stroke},
+	{<<"stroke-dasharray">>, Record#svgimage.stroke_dasharray},
+	{<<"stroke-dashoffset">>, Record#svgimage.stroke_dashoffset},
+	{<<"stroke-linecap">>, Record#svgimage.stroke_linecap},
+	{<<"stroke-linejoin">>, Record#svgimage.stroke_linejoin},
+	{<<"stroke-miterlimit">>, Record#svgimage.stroke_miterlimit},
+	{<<"stroke-opacity">>, Record#svgimage.stroke_opacity},
+	{<<"stroke-width">>, Record#svgimage.stroke_width},
+	{<<"text-anchor">>, Record#svgimage.text_anchor},
+	{<<"text-decoration">>, Record#svgimage.text_decoration},
+	{<<"text-rendering">>, Record#svgimage.text_rendering},
+	{<<"unicode-bidi">>, Record#svgimage.unicode_bidi},
+	{<<"visibility">>, Record#svgimage.visibility},
+	{<<"word-spacing">>, Record#svgimage.word_spacing},
+	{<<"writing-mode">>, Record#svgimage.writing_mode}
+].
+
+svg_xlink(Record)-> [
+	{<<"xlink:href">>, Record#svgimage.xlinkhref},
+	{<<"xlink:type">>, Record#svgimage.xlinktype},
+	{<<"xlink:role">>, Record#svgimage.xlinkrole},
+	{<<"xlink:arcrole">>, Record#svgimage.xlinkarcrole},
+	{<<"xlink:title">>, Record#svgimage.xlinktitle},
+	{<<"xlink:show">>, Record#svgimage.xlinkshow},
+	{<<"xlink:actuate">>, Record#svgimage.xlinkactuate}
+].