Browse Source

last svg tags,

Konstantin Zakablukovsky 9 years ago
parent
commit
6e2c3345cc

+ 7 - 1
include/nitro.hrl

@@ -254,6 +254,7 @@
 -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(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(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(linearGradient, {?ELEMENT_BASE(element_lineargradient), gradientUnits, gradientTransform, x1, y1, x2, y2, spreadMethod, externalResourcesRequired, ?SVG_CORE, ?SVG_PRESENTATION, ?SVG_XLINK}).
+-record(xlink, {?ELEMENT_BASE(element_xlink), target, transform, externalResourcesRequired, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_FILTER_PRIMITIVE, ?SVG_GRAPHICAL_EVENT, ?SVG_PRESENTATION, ?SVG_TRANSFERT_FUNCTION, ?SVG_XLINK}).
 -record(marker, {?ELEMENT_BASE(element_marker), markerUnits, refX, refY, markerWidth, markerHeight, orient, viewBox, preserveAspectRatio, transform, externalResourcesRequired, ?SVG_CORE, ?SVG_PRESENTATION}).
 -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(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(metadata, {?ELEMENT_BASE(element_metadata), ?SVG_CORE}).
@@ -272,8 +273,13 @@
 -record(switch, {?ELEMENT_BASE(element_switch), allowReorderm, transform, externalResourcesRequired, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_GRAPHICAL_EVENT, ?SVG_PRESENTATION}).
 -record(switch, {?ELEMENT_BASE(element_switch), allowReorderm, transform, externalResourcesRequired, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_GRAPHICAL_EVENT, ?SVG_PRESENTATION}).
 -record(symbol, {?ELEMENT_BASE(element_symbol), preserveAspectRatio, viewBox, externalResourcesRequired, ?SVG_CORE, ?SVG_GRAPHICAL_EVENT, ?SVG_PRESENTATION}).
 -record(symbol, {?ELEMENT_BASE(element_symbol), preserveAspectRatio, viewBox, externalResourcesRequired, ?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}).
 -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}).
+-record(textPath, {?ELEMENT_BASE(element_textpath), startOffset, method, spacing, externalResourcesRequired, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_GRAPHICAL_EVENT, ?SVG_PRESENTATION, ?SVG_XLINK}).
+-record(svgtitle, {?ELEMENT_BASE(element_svgtitle), ?SVG_CORE}).
+-record(tref, {?ELEMENT_BASE(element_tref), externalResourcesRequired, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_GRAPHICAL_EVENT, ?SVG_PRESENTATION, ?SVG_XLINK}).
 -record(tspan, {?ELEMENT_BASE(element_tspan), x, y, dx, dy, rotate, textLength, lengthAdjust, externalResourcesRequired, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_GRAPHICAL_EVENT, ?SVG_PRESENTATION}).
 -record(tspan, {?ELEMENT_BASE(element_tspan), x, y, dx, dy, rotate, textLength, lengthAdjust, externalResourcesRequired, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_GRAPHICAL_EVENT, ?SVG_PRESENTATION}).
--record(xlink, {?ELEMENT_BASE(element_xlink), target, transform, externalResourcesRequired, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_FILTER_PRIMITIVE, ?SVG_GRAPHICAL_EVENT, ?SVG_PRESENTATION, ?SVG_TRANSFERT_FUNCTION, ?SVG_XLINK}).
+-record(use, {?ELEMENT_BASE(element_use), x, y, width, height, transform, externalResourcesRequired, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_GRAPHICAL_EVENT, ?SVG_PRESENTATION, ?SVG_XLINK}).
+-record(view, {?ELEMENT_BASE(element_view), viewBox, preserveAspectRatio, zoomAndPan, viewTarget, externalResourcesRequired, ?SVG_CORE}).
+-record(vkern, {?ELEMENT_BASE(element_vkern), u1, g1, u2, g2, k, ?SVG_CORE}).
 
 
 % Actions
 % Actions
 -record(action,  {?ACTION_BASE(undefined)}).
 -record(action,  {?ACTION_BASE(undefined)}).

+ 25 - 0
src/elements/element_svgtitle.erl

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

+ 124 - 0
src/elements/element_textpath.erl

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

+ 121 - 0
src/elements/element_tref.erl

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

+ 126 - 0
src/elements/element_use.erl

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

+ 30 - 0
src/elements/element_view.erl

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

+ 30 - 0
src/elements/element_vkern.erl

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