Browse Source

Last f, g

Konstantin Zakablukovsky 9 years ago
parent
commit
189b7603e4

+ 9 - 0
include/nitro.hrl

@@ -240,6 +240,15 @@
 -record(feTile, {?ELEMENT_BASE(element_fetile), in, ?SVG_CORE, ?SVG_FILTER_PRIMITIVE, ?SVG_PRESENTATION}).
 -record(feTurbulence, {?ELEMENT_BASE(element_feturbulence), baseFrequency, numOctaves, seed, stitchTiles, type, ?SVG_CORE, ?SVG_FILTER_PRIMITIVE, ?SVG_PRESENTATION}).
 -record(filter, {?ELEMENT_BASE(element_filter), x, y, width, height, filterRes, filterUnits, primitiveUnits, externalResourcesRequired, ?SVG_CORE, ?SVG_PRESENTATION, ?SVG_XLINK}).
+-record(font, {?ELEMENT_BASE(element_font), horiz_origin_x, horiz_origin_y, horiz_adv_x, vert_origin_x, vert_origin_y, vert_adv_y, externalResourcesRequired, ?SVG_CORE, ?SVG_PRESENTATION}).
+-record(font_face, {?ELEMENT_BASE(element_fontface), font_family, font_style, font_variant, font_weight, font_stretch, font_size, unicode_range, units_per_em, panose_1, stemv, stemh, slope, cap_height, x_height, accent_height, ascent, descent, widths, bbox, ideographic, alphabetic, mathematical, hanging, v_ideographic, v_alphabetic, v_mathematical, v_hanging, underline_position, underline_thickness, strikethrough_position, strikethrough_thickness, overline_position, overline_thickness, ?SVG_CORE}).
+-record(font_face_format, {?ELEMENT_BASE(element_fontfaceformat), string, ?SVG_CORE}).
+-record(font_face_name, {?ELEMENT_BASE(element_fontfacename), name, ?SVG_CORE}).
+-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(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(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}).

+ 95 - 0
src/elements/element_font.erl

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

+ 58 - 0
src/elements/element_fontface.erl

@@ -0,0 +1,58 @@
+-module(element_fontface).
+-author('Konstantin Zakablukovsky').
+-include("nitro.hrl").
+-compile(export_all).
+
+render_element(Record) ->
+	wf_tags:emit_tag(<<"font-face">>, nitro:render(Record#font_face.body),
+	lists:append([
+		[
+			{<<"id">>, Record#font_face.id},
+			{<<"class">>, Record#font_face.class},
+			{<<"style">>, Record#font_face.style},
+			{<<"font-family">>, Record#font_face.font_family},
+			{<<"font-style">>, Record#font_face.font_style},
+			{<<"font-variant">>, Record#font_face.font_variant},
+			{<<"font-weight">>, Record#font_face.font_weight},
+			{<<"font-stretch">>, Record#font_face.font_stretch},
+			{<<"font-size">>, Record#font_face.font_size},
+			{<<"unicode-range">>, Record#font_face.unicode_range},
+			{<<"units-per-em">>, Record#font_face.units_per_em},
+			{<<"panose-1">>, Record#font_face.panose_1},
+			{<<"stemv">>, Record#font_face.stemv},
+			{<<"stemh">>, Record#font_face.stemh},
+			{<<"slope">>, Record#font_face.slope},
+			{<<"cap-height">>, Record#font_face.cap_height},
+			{<<"x-height">>, Record#font_face.x_height},
+			{<<"accent-height">>, Record#font_face.accent_height},
+			{<<"ascent">>, Record#font_face.ascent},
+			{<<"descent">>, Record#font_face.descent},
+			{<<"widths">>, Record#font_face.widths},
+			{<<"bbox">>, Record#font_face.bbox},
+			{<<"ideographic">>, Record#font_face.ideographic},
+			{<<"alphabetic">>, Record#font_face.alphabetic},
+			{<<"mathematical">>, Record#font_face.mathematical},
+			{<<"hanging">>, Record#font_face.hanging},
+			{<<"v-ideographic">>, Record#font_face.v_ideographic},
+			{<<"v-alphabetic">>, Record#font_face.v_alphabetic},
+			{<<"v-mathematical">>, Record#font_face.v_mathematical},
+			{<<"v-hanging">>, Record#font_face.v_hanging},
+			{<<"underline-position">>, Record#font_face.underline_position},
+			{<<"underline-thickness">>, Record#font_face.underline_thickness},
+			{<<"strikethrough-position">>, Record#font_face.strikethrough_position},
+			{<<"strikethrough-thickness">>, Record#font_face.strikethrough_thickness},
+			{<<"overline-position">>, Record#font_face.overline_position},
+			{<<"overline-thickness">>, Record#font_face.overline_thickness}
+		],
+		svg_core(Record),
+		Record#font_face.data_fields,
+		Record#font_face.aria_states
+	])).
+
+
+%% Common SVG attributes
+svg_core(Record)-> [
+	{<<"xml:base">>, Record#font_face.xmlbase},
+	{<<"xml:lang">>, Record#font_face.xmllang},
+	{<<"xml:space">>, Record#font_face.xmlspace}
+].

+ 26 - 0
src/elements/element_fontfaceformat.erl

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

+ 26 - 0
src/elements/element_fontfacename.erl

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

+ 25 - 0
src/elements/element_fontfacesrc.erl

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

+ 36 - 0
src/elements/element_fontfaceuri.erl

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

+ 115 - 0
src/elements/element_foreignobject.erl

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

+ 98 - 0
src/elements/element_glyph.erl

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

+ 105 - 0
src/elements/element_glyphref.erl

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