SlideShare uma empresa Scribd logo
1 de 38
Baixar para ler offline
Introducing
textorize
   (squint to read)
exploit OS X font
rendering goodness
   through Ruby
pristine font
 rendering
for the web
CSS “font-face”
Flash-based replacement
JS-based replacement
Images
@font-face




  nightmare,
license issues
sIFR 2 + 3 (beta)
sIFR 2 + 3 (beta)




  needs flash
sIFR 2 + 3 (beta)




   sluggish if
    overused
sIFR 2 + 3 (beta)




 fonts must be
   converted
sIFR 2 + 3 (beta)




no subpixel AA
typeface.js, cufon.js
typeface.js, cufon.js




             no subpixel AA
typeface.js, cufon.js




   complicated font
conversion, large .js files
typeface.js, cufon.js




   license issues
Photoshop



      12pt Consolas, no AA



      12pt Consolas, “sharp”



      12pt Consolas, “crisp”
modern fonts
can’t handle no Photoshop
       AA

                     12pt Consolas, no AA



                     12pt Consolas, “sharp”



                     12pt Consolas, “crisp”
Photoshop



      12pt Consolas, no AA



      12pt Consolas, “sharp”



      12pt Consolas, “crisp”
       artifacts on
         curves
Photoshop



      12pt Consolas, no AA



      12pt Consolas, “sharp”
         spacing
          issues
      12pt Consolas, “crisp”
Photoshop



      12pt Consolas, no AA



      12pt Consolas, “sharp”



      12pt Consolas, “crisp”

                no subpixel
                    AA
with Photoshop,
automation from
 a CLI is difficult
ImageMagick




convert  -­‐background  white  -­‐fill  black  -­‐font  
   Consolas.ttf  -­‐pointsize  12  label:OMFGZ  
                     omfgz.png
letter
                   ImageMagick            spacing
                                            fail




convert  -­‐background  white  -­‐fill  black  -­‐font  
   Consolas.ttf  -­‐pointsize  12  label:OMFGZ  
                     omfgz.png
no
subpixel
  AA
                   ImageMagick




convert  -­‐background  white  -­‐fill  black  -­‐font  
   Consolas.ttf  -­‐pointsize  12  label:OMFGZ  
                     omfgz.png
ImageMagick

                                             pixelsoup




convert  -­‐background  white  -­‐fill  black  -­‐font  
   Consolas.ttf  -­‐pointsize  12  label:OMFGZ  
                     omfgz.png
(cc) Luís Flávio Loureiro dos Santos
(cc) Luís Flávio Loureiro dos Santos
© en:2004 David Remahl.
textorize




textorize.rb  -­‐f"Consolas"  -­‐s12  "OMFGZ"
textorize




                  sub-pixel AA

textorize.rb  -­‐f"Consolas"  -­‐s12  "OMFGZ"
textorize




  proper kerning

textorize.rb  -­‐f"Consolas"  -­‐s12  "OMFGZ"
textorize




     CLI
uses installed
    fonts
require  'osx/cocoa'

module  Textorize
    class  Runner
        
        def  initialize(string,  output,  options)
            app  =  OSX::NSApplication.sharedApplication
            
            delegate  =  RunnerApplication.alloc.init
            delegate.options  =  options
            delegate.string  =  string
            delegate.output  =  output
            
            app.setDelegate  delegate
            app.run
        end
        
    end

    class  RunnerApplication  <  OSX::NSObject
        include  OSX
        attr_accessor  :options
        attr_accessor  :string
        attr_accessor  :output

        def  initialize
            @window  =  NSWindow.alloc.initWithContentRect_styleMask_backing_defer([150,  1500,  1000,  500],  NSBorderlessWindowMask,  2,  0)
        end
        
        def  applicationDidFinishLaunching(notification)
            renderer  =  Renderer.new(@window,  @string,  @options)
            Saver.new(renderer).write_to_file(@output)
            NSApplication.sharedApplication.terminate(nil)
        end
        
    end

end
@text_view  =  NSTextView.alloc.initWithFrame([0,0,1000,100])
            
set_attribs  options
window.setContentView  @text_view
@text_view.setString  string
@text_view.sizeToFit
            
window.display
window.orderFrontRegardless
bitmap  =  
NSBitmapImageRep.alloc.initWithFocusedViewRect
(@text_view.bounds)
@png  =  bitmap.representationUsingType_properties(NSPNGFileType,  nil)
@png.writeToFile_atomically(file,  true)
major annoyances (could be fixed)


 needs background color (or no
         subpixel AA)

no text selection (IMHO a feature,
            not a bug)

         not searchable
http://script.aculo.us/thomas

http://github.com/madrobby/textorize

Mais conteúdo relacionado

Destaque (6)

Computer Systems Data Representation
Computer Systems   Data RepresentationComputer Systems   Data Representation
Computer Systems Data Representation
 
Bitmap and vector
Bitmap and vectorBitmap and vector
Bitmap and vector
 
[1] Data Representation
[1] Data Representation[1] Data Representation
[1] Data Representation
 
Bitmap and Vector Images: Make Sure You Know the Differences
Bitmap and Vector Images: Make Sure You Know the DifferencesBitmap and Vector Images: Make Sure You Know the Differences
Bitmap and Vector Images: Make Sure You Know the Differences
 
Intro to scan conversion
Intro to scan conversionIntro to scan conversion
Intro to scan conversion
 
Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...
Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...
Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...
 

Semelhante a Textorize

Plugins by tagomoris #fluentdcasual
Plugins by tagomoris #fluentdcasualPlugins by tagomoris #fluentdcasual
Plugins by tagomoris #fluentdcasual
SATOSHI TAGOMORI
 
Wp7 performance challenges
Wp7 performance challengesWp7 performance challenges
Wp7 performance challenges
Gergely Orosz
 
PHP applications/environments monitoring: APM & Pinba
PHP applications/environments monitoring: APM & PinbaPHP applications/environments monitoring: APM & Pinba
PHP applications/environments monitoring: APM & Pinba
Patrick Allaert
 

Semelhante a Textorize (20)

Skia & Freetype - Android 2D Graphics Essentials
Skia & Freetype - Android 2D Graphics EssentialsSkia & Freetype - Android 2D Graphics Essentials
Skia & Freetype - Android 2D Graphics Essentials
 
Low-level Shader Optimization for Next-Gen and DX11 by Emil Persson
Low-level Shader Optimization for Next-Gen and DX11 by Emil PerssonLow-level Shader Optimization for Next-Gen and DX11 by Emil Persson
Low-level Shader Optimization for Next-Gen and DX11 by Emil Persson
 
Plugins by tagomoris #fluentdcasual
Plugins by tagomoris #fluentdcasualPlugins by tagomoris #fluentdcasual
Plugins by tagomoris #fluentdcasual
 
Dsp file
Dsp fileDsp file
Dsp file
 
Scalaz Stream: Rebirth
Scalaz Stream: RebirthScalaz Stream: Rebirth
Scalaz Stream: Rebirth
 
Scalaz Stream: Rebirth
Scalaz Stream: RebirthScalaz Stream: Rebirth
Scalaz Stream: Rebirth
 
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programingRuby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
 
Wp7 performance challenges
Wp7 performance challengesWp7 performance challenges
Wp7 performance challenges
 
Com 135 final project user manual
Com 135 final project user manualCom 135 final project user manual
Com 135 final project user manual
 
PHP applications/environments monitoring: APM & Pinba
PHP applications/environments monitoring: APM & PinbaPHP applications/environments monitoring: APM & Pinba
PHP applications/environments monitoring: APM & Pinba
 
Scala lens: An introduction
Scala lens: An introductionScala lens: An introduction
Scala lens: An introduction
 
A Graphical Way of Thinking About React Designs
A Graphical Way of Thinking About React DesignsA Graphical Way of Thinking About React Designs
A Graphical Way of Thinking About React Designs
 
PIL - A Platform Independent Language
PIL - A Platform Independent LanguagePIL - A Platform Independent Language
PIL - A Platform Independent Language
 
Hierarchical free monads and software design in fp
Hierarchical free monads and software design in fpHierarchical free monads and software design in fp
Hierarchical free monads and software design in fp
 
The best language in the world
The best language in the worldThe best language in the world
The best language in the world
 
Security benefits of the Nitro architecture - SEP401-R - AWS re:Inforce 2019
Security benefits of the Nitro architecture - SEP401-R - AWS re:Inforce 2019 Security benefits of the Nitro architecture - SEP401-R - AWS re:Inforce 2019
Security benefits of the Nitro architecture - SEP401-R - AWS re:Inforce 2019
 
(1) c sharp introduction_basics_dot_net
(1) c sharp introduction_basics_dot_net(1) c sharp introduction_basics_dot_net
(1) c sharp introduction_basics_dot_net
 
Css3 101
Css3 101Css3 101
Css3 101
 
Eric Lafortune - The Jack and Jill build system
Eric Lafortune - The Jack and Jill build systemEric Lafortune - The Jack and Jill build system
Eric Lafortune - The Jack and Jill build system
 
How to Add Original Library to Android NDK
How to Add Original Library to Android NDKHow to Add Original Library to Android NDK
How to Add Original Library to Android NDK
 

Mais de Thomas Fuchs

Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2KZepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Thomas Fuchs
 

Mais de Thomas Fuchs (9)

Zepto and the rise of the JavaScript Micro-Frameworks
Zepto and the rise of the JavaScript Micro-FrameworksZepto and the rise of the JavaScript Micro-Frameworks
Zepto and the rise of the JavaScript Micro-Frameworks
 
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2KZepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
 
I Can't Believe It's Not Flash
I Can't Believe It's Not FlashI Can't Believe It's Not Flash
I Can't Believe It's Not Flash
 
Prototype & Scriptaculous
Prototype  & ScriptaculousPrototype  & Scriptaculous
Prototype & Scriptaculous
 
Extreme JavaScript Performance
Extreme JavaScript PerformanceExtreme JavaScript Performance
Extreme JavaScript Performance
 
Adventures In JavaScript Testing
Adventures In JavaScript TestingAdventures In JavaScript Testing
Adventures In JavaScript Testing
 
Ruby On Rails Introduction
Ruby On Rails IntroductionRuby On Rails Introduction
Ruby On Rails Introduction
 
Twistori Tech
Twistori TechTwistori Tech
Twistori Tech
 
Rich and Snappy Apps (No Scaling Required)
Rich and Snappy Apps (No Scaling Required)Rich and Snappy Apps (No Scaling Required)
Rich and Snappy Apps (No Scaling Required)
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

Textorize