Browse Source

Requested tags: circle, g, path, rect, text and tspan

Konstantin Zakablukovsky 9 years ago
parent
commit
4976a7e14f

+ 9 - 3
include/nitro.hrl

@@ -199,12 +199,18 @@
 
 % SVG
 -record(svg, {?ELEMENT_BASE(element_svg), version="1.1", baseProfile="full", xmlns="http://www.w3.org/2000/svg", xmlnsxlink="http://www.w3.org/1999/xlink", xmlnsev="http://www.w3.org/2001/xml-events", preserveAspectRatio, contentScriptType, contentStyleType, viewBox, externalResourcesRequired, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_DOCUMENT_EVENT, ?SVG_FILTER_PRIMITIVE, ?SVG_GRAPHICAL_EVENT, ?SVG_PRESENTATION, ?SVG_TRANSFERT_FUNCTION, ?SVG_XLINK}).
-
-% Extras
--record(upload,         {?CTRL_BASE(element_upload), name, value}).
 -record(animate, {?ELEMENT_BASE(element_animate), externalResourcesRequired, ?SVG_ANIMATION_EVENT, ?SVG_ANIMATION_ATTRIBUT_TARGET, ?SVG_ANIMATION_TIMING, ?SVG_ANIMATION_VALUE, ?SVG_ANIMATION_ADDITION, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_XLINK}).
 -record(animateMotion, {?ELEMENT_BASE(element_animatemotion), path, keyPoints, rotate, origin, externalResourcesRequired, ?SVG_ANIMATION_EVENT, ?SVG_ANIMATION_TIMING, ?SVG_ANIMATION_VALUE, ?SVG_ANIMATION_ADDITION,  ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_XLINK}).
 -record(animateTransform, {?ELEMENT_BASE(element_animatetransform), type, externalResourcesRequired, ?SVG_ANIMATION_EVENT, ?SVG_ANIMATION_ATTRIBUT_TARGET, ?SVG_ANIMATION_TIMING, ?SVG_ANIMATION_VALUE, ?SVG_ANIMATION_ADDITION, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_XLINK}).
+-record(circle, {?ELEMENT_BASE(element_circle), cx, cy, r, 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(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}).
+-record(tspan, {?ELEMENT_BASE(element_tspan), x, y, dx, dy, rotate, textLength, lengthAdjust, externalResourcesRequired, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_GRAPHICAL_EVENT, ?SVG_PRESENTATION}).
+
+% Extras
+-record(upload,         {?CTRL_BASE(element_upload), name, value}).
 
 % Actions
 -record(action,  {?ACTION_BASE(undefined)}).

+ 114 - 0
src/elements/element_circle.erl

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

+ 111 - 0
src/elements/element_g.erl

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

+ 113 - 0
src/elements/element_path.erl

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

+ 117 - 0
src/elements/element_rect.erl

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

+ 118 - 0
src/elements/element_text.erl

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

+ 117 - 0
src/elements/element_tspan.erl

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