SlideShare a Scribd company logo
User Defined Characters Solution Proposals October 6, 2010 Jun Fujisawa [email_address]
EGLS Requirements EGLS_CG3 In-line Graphics It should be possible for content providers to embed graphics in text with the intention that the graphics should be aligned, positioned, and sized well with the surrounding text even when the user or reading system selects any writing mode and any font Rationale: People need something beyond characters or character variations commonly available in the present computing environment, which is typically based on Unicode or ISO/IEC 10646 EGLS_CG4  Font Embedding It should be possible for content providers to embed fonts such as SVG Fonts and WOFF Fonts as part of EPUB documents Rationale: Fonts for some characters or character variants might not be always available in any reading system
Solution for Font Embedding EGLS_CG4 Solution A Use '@font-face' rule specified in CSS Fonts Level 3 to reference Web Fonts (WOFF Fonts, SVG Fonts, or OpenType) embedded within the same EPUB container file EPUB 2.0 already supports the use of '@font-face' rule specified in CSS Level 2 Using WOFF Fonts is supported on most browsers and appropriate for general font embedding Issues CSS Level 2 Revision 1 does not specify '@font-face' rule CSS Fonts Level 3 is currently in WD status and may not become CR status in time for EPUB 3.0 WOFF File Format is currently in WD status and may not become CR status in time for EPUB 3.0
Web Fonts Implementations WOFF Fonts are going to be supported everywhere SVG Fonts are currently the only choice for iPhone and iPad    Chrome   Opera   Firefox  WebKit  Safari IE9  IE9 IE SVG WOFF EOT TrueType OpenType Web Browser
Solution A for In-line Graphics EGLS_CG 3  Solution A Use HTML 'img' element to reference an SVG graphics file or SVG fragment in the same HTML file This solution also satisfies EGLS_CG4 SVG is a vector graphic format and better than raster image format like PNG in terms of scalability Using SVG graphics is supported on most browsers and appropriate for describing small numbers of user defined characters or glyphs CSS 2D Transforms can be used to rotate SVG graphics to better support mixed text layout Issues It may be difficult to align SVG graphics with the baseline of the surrounding text It may be difficult to change SVG graphics based on the font family used for the surrounding text
SVG In-line Graphics SVG File Example Use 'path' element to define a character glyph Use 'viewBox' attribute to use local coordinate system The path describes a Hiragana character &quot; の &quot; HTML File Example Use 'img' element to display SVG graphics Referencing an SVG file from 'img' element is already supported on most browsers <svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 1000 1000&quot;> <title>IPA Mincho</title> <path fill=&quot;black&quot; d=&quot; M505 683 Q512 642 512 585 Q512 417 393 225 Q338 137 266 88 Q236 70 214 70 Q178 70 146 107 Q91 169 91 279 Q91 450 218 582 Q348 716 528 716 Q666 716 762 649 Q901 553 901 378 Q901 193 767 98 Q668 27 488 16 L482 41..../ > </svg> <html   xmlns=&quot;http://www.w3.org/1999/xhtml&quot;> <head> <title>Solution A</title> </head> <body> <div style=&quot;font-size:100px;&quot;> なにぬね <img src=&quot;IPAMincho.svg&quot; width=&quot;100&quot; height=&quot;100&quot;> </div> </body> </html>
Solution B for In-line Graphics EGLS_CG 3  Solution  B Use SVG 'font' element to define graphics as SVG Fonts and put that definition directly into HTML 'head' element. In the same HTML file, we can just specify the 'font-family' for the SVG Font to display the corresponding graphics. This solution also satisfies EGLS_CG4. SVG Fonts behave just like normal fonts, and the text can be aligned, selected, and searched very easily. Issues SVG Fonts may not be supported on some browsers (IE and Firefox). SVG Fonts don't support hinting and may not be rendered in highest quality on some display conditions. SVG 1.1 supports both vertical and horizontal layout for SVG Fonts, but SVG Tiny 1.2 only supports horizontal layout.
SVG Fonts In-line Graphics HTML File Example Use SVG 'glyph' element to define a character glyph Use HTML 'span' element to specify the font family name of the SVG Font The use of CSS '@font-face' rule is not required Any glyphs without code points can be defined <html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;> <head> <title>Solution B</title> <svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;100&quot; height=&quot;100&quot;> <defs> <font horiz-origin-x=&quot;0&quot; horiz-adv-x=&quot;1000&quot; id=&quot;IPAMincho&quot;> <font-face font-family=&quot;IPAMincho&quot; units-per-em=&quot;1000&quot; ascent=&quot;880&quot; descent=&quot;120&quot;/> <glyph unicode=&quot; の &quot; glyph-name =&quot; の &quot; vert-origin-y=&quot;786&quot; vert-adv-y=&quot;870&quot; d=&quot;M505 683 Q512 642 512 585…&quot;/> </font> </defs> </svg> </head> <body> <div style=&quot;font-size:100px;&quot;> なにぬね <span style=&quot;font-family:IPAMincho;&quot;> の </span> </div> </body> </html>
Rendering Quality SVG Fonts Example by John Daggett people.mozilla.org/~jdaggett/tests/svgfonttest.html Rendered by Safari on Mac OS X
Effect of Hinting Meiryo Fonts Example by John Daggett Rendered by Firefox on Windows XP, Windows 7, and Mac OS X, respectively
Appendix
Web Fonts Overview Web Fonts Specification Introduced in CSS Level 2 www.w3.org/TR/2008/REC-CSS2-20080411 Enhanced in CSS Fonts Level 3 www.w3.org/TR/2009/WD-css3-fonts-20090618 Major Features Supports downloadable fonts, local fonts, and system fonts Font properties ('font-family', 'font-weight', 'font-stretch',  'font-style', 'font-variant', 'font-size', 'font-size-adjust', 'font') Font reference rules (@font-face, 'src', 'unicode-range') Font matching algorithm
Web Fonts Examples Multi Weights Example One rule for each weight Use 'local' to use local fonts if available Use 'url' to reference downloadable fonts Composite Font Example One rule for each language specific font subset file Use &quot;-&quot; to specify range Use &quot;?&quot; for any digit value  Download smaller subset file if the text contains only Latin characters @font-face { font-family: Helvetica; src: local(Helvetica), url(fonts/Helvetica.ttf); } @font-face { font-family: Helvetica; font-weight: bold; src: local(&quot;Helvetica Bold&quot;), url(fonts/HelveticaBold.ttf); } @font-face { font-family: DroidSans; src: url(DroidSansJp.woff); unicode-range: U+3000-9FFF, U+FF??; } @font-face { font-family: DroidSans; src: url(DroidSans.woff); unicode-range: U+000-5FF, U+1 E 00-1 FFF , U+2000-2300 ; }
New in CSS Fonts Level 3  Renewed Font Format List &quot;truetype&quot;, &quot;truetype-aat&quot; : TrueType Font (.ttf) &quot;opentype&quot;: OpenType Font (.ttf, .otf) &quot;embedded-opentype&quot;: Embedded OpenType Font (.eot) &quot;woff&quot;: WOFF Font (.woff) &quot;svg&quot;: SVG Font (.svg) OpenType Features Support Kerning ('font-kerning') and ligatures ('font-variant-ligatures') Subscript and superscript ('character-transform') Alternates and swashes ('font-variant-alternates') Capitalization ('font-variant-caps') Numerical formatting ('font-variant-numeric') Same-origin Restriction Cross-Origin Resource Sharing (CORS) should be supported as well
WOFF Font Format WOFF Font Specification WOFF File Format 1.0 www.w3.org/TR/2010/WD-WOFF-20100727 WOFF stands for Web Open Font Format Progress WebFonts Working Group launched in March 2010 W3C Submission from Microsoft, Mozilla, and Opera in April Already implemented on Firefox 3.6, Google Chrome 5, and IE9 Platform Preview 3 Major Features A GZIP compressed repackaging of TrueType/OpenType fonts Added XML based extended metadata block No DRM (WOFF fonts may not be reused as system fonts) Same-origin restriction as well as CORS is supported
Handling Variations East Asian Text The editor's draft of CSS Fonts Level 3 introduced  'font-variant-east-asian' property Supports OpenType Feature Tags (hojo-kanji, jis78, jis83, jis90, jis04, nlckanji, simplified, traditional, fwid, pwid) OpenType UVS Subtable should be supported as well? Example of Variations JIS78 Forms (jis78)   ■  Traditional Forms (traditional) Proportionally Spaced Variants (pwid)
SVG Fonts Overview SVG Fonts Specification Introduced in SVG 1.0 www.w3.org/TR/2001/REC-SVG-20010904 Reduced the features in SVG Tiny 1.2 www.w3.org/TR/2008/REC-SVGTiny12-20081222 Mandatory feature in SVG 1.1/2.0 (required for ACID3) Major Features Embedded within HTML/SVG documents or saved as a separate SVG file (GZIP compressed .svgz file is supported) Define font with 'font' ('horiz-origin-x', 'horiz-adv-x') and 'font-face' elements ('font-family', 'font-weight', etc.) Define each glyph with 'glyph' element ('unicode', 'glyph-name', 'd', 'arabic-form', 'lang', 'horiz-adv-x') Hinted outline fonts is not supported
SVG Fonts Examples Inline Font Example One 'glyph' for each glyph 'd' value contains path data defining the glyph outline 'unicode' value can be a character or string (to define ligatures, for example) External Font Example Font definition can be moved to local or downloadable files Use 'font-face-uri' to point to external SVG Font files Need to directly reference 'font' element (by using a fragment identifier) <defs> <font horiz-adv-x=&quot;500&quot;> <font-face font-family=&quot;Vera&quot; units-per-em=&quot;1000&quot;/> <glyph unicode=&quot;S&quot;   glyph-name=&quot;S&quot; d=&quot;…&quot;> <glyph unicode=&quot;V&quot;   glyph-name=&quot;V&quot; d=&quot;…&quot;> <glyph unicode=&quot;G&quot;   glyph-name=&quot;G&quot; d=&quot;…&quot;> <missing-glyph d=&quot;…&quot;> </font> </defs> <text font-family=&quot;Vera&quot; font-size=&quot;100&quot;>SVG</text> <defs><font> <font-face font-family=&quot;Vera&quot;> <font-face-src> <font-face-uri xlink:href=&quot;Vera.svg#f&quot;/> </font-face-src> </font-face> </font></defs> <text font-family=&quot;Vera&quot; font-size=&quot;100&quot;>SVG</text>
New in SVG Tiny 1.2  No Arbitrary SVG Specify glyph outline only by using path data (with 'd' attribute) 'glyph' element in SVG 1.0/1.1 can contain arbitrary SVG graphic elements) No Vertical Orientation Unsupported 'font' element attributes: 'horiz-origin-y', 'vert-origin-x', 'vert-origin-y', 'vert-adv-y' Unsupported 'font-face' element attributes: 'v-ideographic', ' v-alphabetic ', ' v-mathematical ', ' v-hanging ' Unsupported 'glyph' element attributes: 'orientation', 'vert-origin-x', 'vert-origin-y', 'vert-adv-y' No External Font Descriptors  'definition-src' element is not supported in SVG Tiny 1.2 and SVG 1.1 2 nd  Edition
Extending Existing Fonts Extended Font Example Add @font-face rule for each user defined character Use 'unicode-range' to specify the code point Default 'unicode-range' value is U+0-10FFFF Rules defined later take precedence  Referencing from HTML Just use the extended font Referencing user defined characters is easy as log as the code point is assigned @font-face { font-family: Helvetica; src: local(Arial); } @font-face { font-family: Helvetica; src: url(HelveticaEx01.svg#f); unicode-range: U+E758; } @font-face { font-family: Helvetica; src: url(HelveticaEx02.svg#f); unicode-range: U+E759; } body { font-family: Helvetica; } <html> <body> <p>&#xE758;SVG&#xE759;</p> </body> </html>
Glyphs without Code Points SVG Glyph Example Use unique identifier in stead of a character as the value of 'unicode' SVG user agent recognizes the specific sequence of characters and replace it with user defied glyph Referencing from HTML Use 'image' element to display a glyph image You can directly embed an SVG fragment into the HTML5 document <defs> <font horiz-adv-x=&quot;500&quot;> <font-face font-family=&quot;Vera&quot; units-per-em=&quot;1000&quot;/> <glyph unicode=&quot;&edanashi;&quot;   glyph-name=&quot;edanashi&quot; d=&quot;…&quot;> <missing-glyph d=&quot;…&quot;> </font> </defs> <text font-family=&quot;Vera&quot; font-size=&quot;100&quot;>&edanashi;</text> body { font-family: Vera; } <html> <body> <p>Edanashi in HTML: <img src=&quot;edanashi.svg#f/>   </p> <svg>   <text>Edanashi in SVG:   &edanashi;</text>   </svg> </body> </html>

More Related Content

PPT
User Defined Characters and SVG Fonts
PDF
HTML 5 Step By Step - Ebook
PPT
PPT
php 1
PDF
Intro to html revised2
PPT
html
PPTX
Html and Xhtml
ODP
Cascading Style Sheets - Part 01
User Defined Characters and SVG Fonts
HTML 5 Step By Step - Ebook
php 1
Intro to html revised2
html
Html and Xhtml
Cascading Style Sheets - Part 01

What's hot (17)

PDF
Html text and formatting
PPT
Xhtml 2010
PDF
Html css workshop, lesson 0, how browsers work
PPTX
Session no 4
PPT
Origins and evolution of HTML and XHTML
PDF
Introduction to XML, XHTML and CSS
PPTX
Css3 Complete Reference
PDF
Web I - 02 - XHTML Introduction
PPTX
Css, xhtml, javascript
PPT
Introduction to Web Design
PPTX
Embrace the Mullet: CSS is the 'Party in the Back' (a CSS How-to)
PPT
HTML5 Fundamentals
PPSX
Introduction to Html5
PDF
Perch CMS Summit: Perch Template Tips and Tricks
PPTX
Html5 ppt
Html text and formatting
Xhtml 2010
Html css workshop, lesson 0, how browsers work
Session no 4
Origins and evolution of HTML and XHTML
Introduction to XML, XHTML and CSS
Css3 Complete Reference
Web I - 02 - XHTML Introduction
Css, xhtml, javascript
Introduction to Web Design
Embrace the Mullet: CSS is the 'Party in the Back' (a CSS How-to)
HTML5 Fundamentals
Introduction to Html5
Perch CMS Summit: Perch Template Tips and Tricks
Html5 ppt
Ad

Similar to User Defined Characters Solution Proposal (20)

PPT
Implementing @font-face
PPT
How do speed up web pages? CSS & HTML Tricks
PPTX
HTML5 and CSS3 Techniques You Can Use Today
KEY
CSS @font-face : Personalized fonts
PDF
cdac@parag.gajbhiye@test123
ODP
Css3 101
KEY
Web Typography with sIFR 3 at Drupalcamp Copenhagen
ODP
Cascading Style Sheets - Part 02
PPT
Rich User Interaction with SVG
PPT
Web font services: March 2011
ODP
Rmll2010 html5-css3-english
PDF
new fonts for the web
PDF
The Trouble With Type
PPT
Introduction to Alfresco Surf Platform
PDF
Drupal Camp LA 2011: Typography modules for Drupal
PDF
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
PPT
Internet Explorer 8 for Developers by Christian Thilmany
PDF
Making drupal beautiful with web fonts
PPT
Html Expression Web
Implementing @font-face
How do speed up web pages? CSS & HTML Tricks
HTML5 and CSS3 Techniques You Can Use Today
CSS @font-face : Personalized fonts
cdac@parag.gajbhiye@test123
Css3 101
Web Typography with sIFR 3 at Drupalcamp Copenhagen
Cascading Style Sheets - Part 02
Rich User Interaction with SVG
Web font services: March 2011
Rmll2010 html5-css3-english
new fonts for the web
The Trouble With Type
Introduction to Alfresco Surf Platform
Drupal Camp LA 2011: Typography modules for Drupal
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Internet Explorer 8 for Developers by Christian Thilmany
Making drupal beautiful with web fonts
Html Expression Web
Ad

More from Jun Fujisawa (8)

PDF
OpenTypeカラーフォントと関連技術の動向
PDF
OpenTypeカラーフォントの標準化
PDF
HTTP 2.0のヘッダ圧縮(HPACK)
PDF
SVG標準化の最新動向
PDF
WebフォントとSVGフォント
PDF
SVGフォントを使った外字表現
KEY
RobinとWidgeon
KEY
WebアプリプラットフォームとしてのHTML5とSVG
OpenTypeカラーフォントと関連技術の動向
OpenTypeカラーフォントの標準化
HTTP 2.0のヘッダ圧縮(HPACK)
SVG標準化の最新動向
WebフォントとSVGフォント
SVGフォントを使った外字表現
RobinとWidgeon
WebアプリプラットフォームとしてのHTML5とSVG

Recently uploaded (20)

PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
Mushroom cultivation and it's methods.pdf
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Web App vs Mobile App What Should You Build First.pdf
PDF
Enhancing emotion recognition model for a student engagement use case through...
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
August Patch Tuesday
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
Hindi spoken digit analysis for native and non-native speakers
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
project resource management chapter-09.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Assigned Numbers - 2025 - Bluetooth® Document
WOOl fibre morphology and structure.pdf for textiles
Mushroom cultivation and it's methods.pdf
Group 1 Presentation -Planning and Decision Making .pptx
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Web App vs Mobile App What Should You Build First.pdf
Enhancing emotion recognition model for a student engagement use case through...
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
August Patch Tuesday
1 - Historical Antecedents, Social Consideration.pdf
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
DP Operators-handbook-extract for the Mautical Institute
Hindi spoken digit analysis for native and non-native speakers
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
A comparative analysis of optical character recognition models for extracting...
project resource management chapter-09.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Assigned Numbers - 2025 - Bluetooth® Document

User Defined Characters Solution Proposal

  • 1. User Defined Characters Solution Proposals October 6, 2010 Jun Fujisawa [email_address]
  • 2. EGLS Requirements EGLS_CG3 In-line Graphics It should be possible for content providers to embed graphics in text with the intention that the graphics should be aligned, positioned, and sized well with the surrounding text even when the user or reading system selects any writing mode and any font Rationale: People need something beyond characters or character variations commonly available in the present computing environment, which is typically based on Unicode or ISO/IEC 10646 EGLS_CG4 Font Embedding It should be possible for content providers to embed fonts such as SVG Fonts and WOFF Fonts as part of EPUB documents Rationale: Fonts for some characters or character variants might not be always available in any reading system
  • 3. Solution for Font Embedding EGLS_CG4 Solution A Use '@font-face' rule specified in CSS Fonts Level 3 to reference Web Fonts (WOFF Fonts, SVG Fonts, or OpenType) embedded within the same EPUB container file EPUB 2.0 already supports the use of '@font-face' rule specified in CSS Level 2 Using WOFF Fonts is supported on most browsers and appropriate for general font embedding Issues CSS Level 2 Revision 1 does not specify '@font-face' rule CSS Fonts Level 3 is currently in WD status and may not become CR status in time for EPUB 3.0 WOFF File Format is currently in WD status and may not become CR status in time for EPUB 3.0
  • 4. Web Fonts Implementations WOFF Fonts are going to be supported everywhere SVG Fonts are currently the only choice for iPhone and iPad    Chrome   Opera   Firefox  WebKit  Safari IE9  IE9 IE SVG WOFF EOT TrueType OpenType Web Browser
  • 5. Solution A for In-line Graphics EGLS_CG 3 Solution A Use HTML 'img' element to reference an SVG graphics file or SVG fragment in the same HTML file This solution also satisfies EGLS_CG4 SVG is a vector graphic format and better than raster image format like PNG in terms of scalability Using SVG graphics is supported on most browsers and appropriate for describing small numbers of user defined characters or glyphs CSS 2D Transforms can be used to rotate SVG graphics to better support mixed text layout Issues It may be difficult to align SVG graphics with the baseline of the surrounding text It may be difficult to change SVG graphics based on the font family used for the surrounding text
  • 6. SVG In-line Graphics SVG File Example Use 'path' element to define a character glyph Use 'viewBox' attribute to use local coordinate system The path describes a Hiragana character &quot; の &quot; HTML File Example Use 'img' element to display SVG graphics Referencing an SVG file from 'img' element is already supported on most browsers <svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 1000 1000&quot;> <title>IPA Mincho</title> <path fill=&quot;black&quot; d=&quot; M505 683 Q512 642 512 585 Q512 417 393 225 Q338 137 266 88 Q236 70 214 70 Q178 70 146 107 Q91 169 91 279 Q91 450 218 582 Q348 716 528 716 Q666 716 762 649 Q901 553 901 378 Q901 193 767 98 Q668 27 488 16 L482 41..../ > </svg> <html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;> <head> <title>Solution A</title> </head> <body> <div style=&quot;font-size:100px;&quot;> なにぬね <img src=&quot;IPAMincho.svg&quot; width=&quot;100&quot; height=&quot;100&quot;> </div> </body> </html>
  • 7. Solution B for In-line Graphics EGLS_CG 3 Solution B Use SVG 'font' element to define graphics as SVG Fonts and put that definition directly into HTML 'head' element. In the same HTML file, we can just specify the 'font-family' for the SVG Font to display the corresponding graphics. This solution also satisfies EGLS_CG4. SVG Fonts behave just like normal fonts, and the text can be aligned, selected, and searched very easily. Issues SVG Fonts may not be supported on some browsers (IE and Firefox). SVG Fonts don't support hinting and may not be rendered in highest quality on some display conditions. SVG 1.1 supports both vertical and horizontal layout for SVG Fonts, but SVG Tiny 1.2 only supports horizontal layout.
  • 8. SVG Fonts In-line Graphics HTML File Example Use SVG 'glyph' element to define a character glyph Use HTML 'span' element to specify the font family name of the SVG Font The use of CSS '@font-face' rule is not required Any glyphs without code points can be defined <html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;> <head> <title>Solution B</title> <svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;100&quot; height=&quot;100&quot;> <defs> <font horiz-origin-x=&quot;0&quot; horiz-adv-x=&quot;1000&quot; id=&quot;IPAMincho&quot;> <font-face font-family=&quot;IPAMincho&quot; units-per-em=&quot;1000&quot; ascent=&quot;880&quot; descent=&quot;120&quot;/> <glyph unicode=&quot; の &quot; glyph-name =&quot; の &quot; vert-origin-y=&quot;786&quot; vert-adv-y=&quot;870&quot; d=&quot;M505 683 Q512 642 512 585…&quot;/> </font> </defs> </svg> </head> <body> <div style=&quot;font-size:100px;&quot;> なにぬね <span style=&quot;font-family:IPAMincho;&quot;> の </span> </div> </body> </html>
  • 9. Rendering Quality SVG Fonts Example by John Daggett people.mozilla.org/~jdaggett/tests/svgfonttest.html Rendered by Safari on Mac OS X
  • 10. Effect of Hinting Meiryo Fonts Example by John Daggett Rendered by Firefox on Windows XP, Windows 7, and Mac OS X, respectively
  • 12. Web Fonts Overview Web Fonts Specification Introduced in CSS Level 2 www.w3.org/TR/2008/REC-CSS2-20080411 Enhanced in CSS Fonts Level 3 www.w3.org/TR/2009/WD-css3-fonts-20090618 Major Features Supports downloadable fonts, local fonts, and system fonts Font properties ('font-family', 'font-weight', 'font-stretch', 'font-style', 'font-variant', 'font-size', 'font-size-adjust', 'font') Font reference rules (@font-face, 'src', 'unicode-range') Font matching algorithm
  • 13. Web Fonts Examples Multi Weights Example One rule for each weight Use 'local' to use local fonts if available Use 'url' to reference downloadable fonts Composite Font Example One rule for each language specific font subset file Use &quot;-&quot; to specify range Use &quot;?&quot; for any digit value Download smaller subset file if the text contains only Latin characters @font-face { font-family: Helvetica; src: local(Helvetica), url(fonts/Helvetica.ttf); } @font-face { font-family: Helvetica; font-weight: bold; src: local(&quot;Helvetica Bold&quot;), url(fonts/HelveticaBold.ttf); } @font-face { font-family: DroidSans; src: url(DroidSansJp.woff); unicode-range: U+3000-9FFF, U+FF??; } @font-face { font-family: DroidSans; src: url(DroidSans.woff); unicode-range: U+000-5FF, U+1 E 00-1 FFF , U+2000-2300 ; }
  • 14. New in CSS Fonts Level 3 Renewed Font Format List &quot;truetype&quot;, &quot;truetype-aat&quot; : TrueType Font (.ttf) &quot;opentype&quot;: OpenType Font (.ttf, .otf) &quot;embedded-opentype&quot;: Embedded OpenType Font (.eot) &quot;woff&quot;: WOFF Font (.woff) &quot;svg&quot;: SVG Font (.svg) OpenType Features Support Kerning ('font-kerning') and ligatures ('font-variant-ligatures') Subscript and superscript ('character-transform') Alternates and swashes ('font-variant-alternates') Capitalization ('font-variant-caps') Numerical formatting ('font-variant-numeric') Same-origin Restriction Cross-Origin Resource Sharing (CORS) should be supported as well
  • 15. WOFF Font Format WOFF Font Specification WOFF File Format 1.0 www.w3.org/TR/2010/WD-WOFF-20100727 WOFF stands for Web Open Font Format Progress WebFonts Working Group launched in March 2010 W3C Submission from Microsoft, Mozilla, and Opera in April Already implemented on Firefox 3.6, Google Chrome 5, and IE9 Platform Preview 3 Major Features A GZIP compressed repackaging of TrueType/OpenType fonts Added XML based extended metadata block No DRM (WOFF fonts may not be reused as system fonts) Same-origin restriction as well as CORS is supported
  • 16. Handling Variations East Asian Text The editor's draft of CSS Fonts Level 3 introduced 'font-variant-east-asian' property Supports OpenType Feature Tags (hojo-kanji, jis78, jis83, jis90, jis04, nlckanji, simplified, traditional, fwid, pwid) OpenType UVS Subtable should be supported as well? Example of Variations JIS78 Forms (jis78) ■ Traditional Forms (traditional) Proportionally Spaced Variants (pwid)
  • 17. SVG Fonts Overview SVG Fonts Specification Introduced in SVG 1.0 www.w3.org/TR/2001/REC-SVG-20010904 Reduced the features in SVG Tiny 1.2 www.w3.org/TR/2008/REC-SVGTiny12-20081222 Mandatory feature in SVG 1.1/2.0 (required for ACID3) Major Features Embedded within HTML/SVG documents or saved as a separate SVG file (GZIP compressed .svgz file is supported) Define font with 'font' ('horiz-origin-x', 'horiz-adv-x') and 'font-face' elements ('font-family', 'font-weight', etc.) Define each glyph with 'glyph' element ('unicode', 'glyph-name', 'd', 'arabic-form', 'lang', 'horiz-adv-x') Hinted outline fonts is not supported
  • 18. SVG Fonts Examples Inline Font Example One 'glyph' for each glyph 'd' value contains path data defining the glyph outline 'unicode' value can be a character or string (to define ligatures, for example) External Font Example Font definition can be moved to local or downloadable files Use 'font-face-uri' to point to external SVG Font files Need to directly reference 'font' element (by using a fragment identifier) <defs> <font horiz-adv-x=&quot;500&quot;> <font-face font-family=&quot;Vera&quot; units-per-em=&quot;1000&quot;/> <glyph unicode=&quot;S&quot; glyph-name=&quot;S&quot; d=&quot;…&quot;> <glyph unicode=&quot;V&quot; glyph-name=&quot;V&quot; d=&quot;…&quot;> <glyph unicode=&quot;G&quot; glyph-name=&quot;G&quot; d=&quot;…&quot;> <missing-glyph d=&quot;…&quot;> </font> </defs> <text font-family=&quot;Vera&quot; font-size=&quot;100&quot;>SVG</text> <defs><font> <font-face font-family=&quot;Vera&quot;> <font-face-src> <font-face-uri xlink:href=&quot;Vera.svg#f&quot;/> </font-face-src> </font-face> </font></defs> <text font-family=&quot;Vera&quot; font-size=&quot;100&quot;>SVG</text>
  • 19. New in SVG Tiny 1.2 No Arbitrary SVG Specify glyph outline only by using path data (with 'd' attribute) 'glyph' element in SVG 1.0/1.1 can contain arbitrary SVG graphic elements) No Vertical Orientation Unsupported 'font' element attributes: 'horiz-origin-y', 'vert-origin-x', 'vert-origin-y', 'vert-adv-y' Unsupported 'font-face' element attributes: 'v-ideographic', ' v-alphabetic ', ' v-mathematical ', ' v-hanging ' Unsupported 'glyph' element attributes: 'orientation', 'vert-origin-x', 'vert-origin-y', 'vert-adv-y' No External Font Descriptors 'definition-src' element is not supported in SVG Tiny 1.2 and SVG 1.1 2 nd Edition
  • 20. Extending Existing Fonts Extended Font Example Add @font-face rule for each user defined character Use 'unicode-range' to specify the code point Default 'unicode-range' value is U+0-10FFFF Rules defined later take precedence Referencing from HTML Just use the extended font Referencing user defined characters is easy as log as the code point is assigned @font-face { font-family: Helvetica; src: local(Arial); } @font-face { font-family: Helvetica; src: url(HelveticaEx01.svg#f); unicode-range: U+E758; } @font-face { font-family: Helvetica; src: url(HelveticaEx02.svg#f); unicode-range: U+E759; } body { font-family: Helvetica; } <html> <body> <p>&#xE758;SVG&#xE759;</p> </body> </html>
  • 21. Glyphs without Code Points SVG Glyph Example Use unique identifier in stead of a character as the value of 'unicode' SVG user agent recognizes the specific sequence of characters and replace it with user defied glyph Referencing from HTML Use 'image' element to display a glyph image You can directly embed an SVG fragment into the HTML5 document <defs> <font horiz-adv-x=&quot;500&quot;> <font-face font-family=&quot;Vera&quot; units-per-em=&quot;1000&quot;/> <glyph unicode=&quot;&edanashi;&quot; glyph-name=&quot;edanashi&quot; d=&quot;…&quot;> <missing-glyph d=&quot;…&quot;> </font> </defs> <text font-family=&quot;Vera&quot; font-size=&quot;100&quot;>&edanashi;</text> body { font-family: Vera; } <html> <body> <p>Edanashi in HTML: <img src=&quot;edanashi.svg#f/> </p> <svg> <text>Edanashi in SVG: &edanashi;</text> </svg> </body> </html>