Commit 2181007a authored by Colm's avatar Colm

Un 's' et mes debuts

parent a49929fe
This diff is collapsed.
This diff is collapsed.
%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 0 0 0 0
%%HiResBoundingBox: 0 0 0 0
%%Creator: MetaPost 1.504
%%CreationDate: 2013.03.12:1756
%%Pages: 1
%%DocumentResources: procset mpost-minimal
%%DocumentSuppliedResources: procset mpost-minimal
%%EndComments
%%BeginProlog
%%BeginResource: procset mpost-minimal
/bd{bind def}bind def/fshow {exch findfont exch scalefont setfont show}bd
/fcp{findfont dup length dict begin{1 index/FID ne{def}{pop pop}ifelse}forall}bd
/fmc{FontMatrix dup length array copy dup dup}bd/fmd{/FontMatrix exch def}bd
/Amul{4 -1 roll exch mul 1000 div}bd/ExtendFont{fmc 0 get Amul 0 exch put fmd}bd
/ScaleFont{dup fmc 0 get Amul 0 exch put dup dup 3 get Amul 3 exch put fmd}bd
/SlantFont{fmc 2 get dup 0 eq{pop 1}if Amul FontMatrix 0 get mul 2 exch put fmd}bd
%%EndResource
%%EndProlog
%%BeginSetup
%%EndSetup
%%Page: 1 1
showpage
%%EOF
require 'autotest/fsevent'
require 'autotest/growl'
screeen.css
.sass-cache
.bundle
config/user.rb
db.yml
.DS_Store
*.swp
vendor
[submodule "mf"]
path = mf
url = git@github.com:greyfont/metaflop-font.git
--format nested
--color
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
# Uncomment if you are using Rails' asset pipeline
# load 'deploy/assets'
Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
load 'config/deploy' # remove this line to skip loading any of the default tasks
source :rubygems
gem 'sinatra'
gem 'sinatra-contrib'
gem 'sass'
gem 'mustache'
gem 'data_mapper'
gem 'dm-mysql-adapter'
gem 'sinatra-simple-navigation'
gem 'bourbon'
gem 'rubyzip'
group :development do
gem 'capistrano'
gem 'rvm-capistrano'
gem 'rspec'
end
GEM
remote: http://rubygems.org/
specs:
activesupport (3.2.2)
i18n (~> 0.6)
multi_json (~> 1.0)
addressable (2.2.6)
backports (2.3.0)
bcrypt-ruby (3.0.1)
bourbon (1.4.0)
sass (>= 3.1)
capistrano (2.12.0)
highline
net-scp (>= 1.0.0)
net-sftp (>= 2.0.0)
net-ssh (>= 2.0.14)
net-ssh-gateway (>= 1.1.0)
data_mapper (1.2.0)
dm-aggregates (~> 1.2.0)
dm-constraints (~> 1.2.0)
dm-core (~> 1.2.0)
dm-migrations (~> 1.2.0)
dm-serializer (~> 1.2.0)
dm-timestamps (~> 1.2.0)
dm-transactions (~> 1.2.0)
dm-types (~> 1.2.0)
dm-validations (~> 1.2.0)
data_objects (0.10.7)
addressable (~> 2.1)
diff-lcs (1.1.2)
dm-aggregates (1.2.0)
dm-core (~> 1.2.0)
dm-constraints (1.2.0)
dm-core (~> 1.2.0)
dm-core (1.2.0)
addressable (~> 2.2.6)
dm-do-adapter (1.2.0)
data_objects (~> 0.10.6)
dm-core (~> 1.2.0)
dm-migrations (1.2.0)
dm-core (~> 1.2.0)
dm-mysql-adapter (1.2.0)
dm-do-adapter (~> 1.2.0)
do_mysql (~> 0.10.6)
dm-serializer (1.2.1)
dm-core (~> 1.2.0)
fastercsv (~> 1.5.4)
json (~> 1.6.1)
json_pure (~> 1.6.1)
multi_json (~> 1.0.3)
dm-timestamps (1.2.0)
dm-core (~> 1.2.0)
dm-transactions (1.2.0)
dm-core (~> 1.2.0)
dm-types (1.2.1)
bcrypt-ruby (~> 3.0.0)
dm-core (~> 1.2.0)
fastercsv (~> 1.5.4)
json (~> 1.6.1)
multi_json (~> 1.0.3)
stringex (~> 1.3.0)
uuidtools (~> 2.1.2)
dm-validations (1.2.0)
dm-core (~> 1.2.0)
do_mysql (0.10.7)
data_objects (= 0.10.7)
eventmachine (0.12.10)
fastercsv (1.5.4)
highline (1.6.13)
i18n (0.6.0)
json (1.6.5)
json_pure (1.6.5)
multi_json (1.0.4)
mustache (0.99.4)
net-scp (1.0.4)
net-ssh (>= 1.99.1)
net-sftp (2.0.5)
net-ssh (>= 2.0.9)
net-ssh (2.5.2)
net-ssh-gateway (1.1.0)
net-ssh (>= 1.99.1)
rack (1.5.2)
rack-protection (1.3.2)
rack
rack-test (0.6.1)
rack (>= 1.0)
rspec (2.5.0)
rspec-core (~> 2.5.0)
rspec-expectations (~> 2.5.0)
rspec-mocks (~> 2.5.0)
rspec-core (2.5.1)
rspec-expectations (2.5.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.5.0)
rubyzip (0.9.9)
rvm-capistrano (1.2.7)
capistrano (>= 2.0.0)
sass (3.1.12)
simple-navigation (3.7.0)
activesupport (>= 2.3.2)
sinatra (1.3.4)
rack (~> 1.4)
rack-protection (~> 1.3)
tilt (~> 1.3, >= 1.3.3)
sinatra-contrib (1.3.1)
backports (>= 2.0)
eventmachine
rack-protection
rack-test
sinatra (~> 1.3.0)
tilt (~> 1.3)
sinatra-simple-navigation (3.5.1)
simple-navigation (>= 3.5.0)
stringex (1.3.0)
tilt (1.3.3)
uuidtools (2.1.2)
PLATFORMS
ruby
DEPENDENCIES
bourbon
capistrano
data_mapper
dm-mysql-adapter
mustache
rspec
rubyzip
rvm-capistrano
sass
sinatra
sinatra-contrib
sinatra-simple-navigation
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
guard 'mozrepl' do
watch(/.+\.html/)
watch(/assets\/css\/(.+\.css)/)
watch(/assets\/js\/(.+\.js)/)
end
### or with options...
# guard 'mozrepl', :host => 'localhost', :port => 4242, :verbose => true do
# ...
#
# metaflop - web interface
# © 2012 by alexis reigel
# www.metaflop.com
#
# licensed under gpl v3
#
# encoding: UTF-8
require 'sinatra'
require 'sinatra/reloader'
require 'sinatra/config_file'
require 'sinatra/simple-navigation'
require 'sass'
require 'mustache/sinatra'
require 'time'
require 'data_mapper' # metagem, requires common plugins too.
require './lib/metaflop'
require './lib/url'
class App < Sinatra::Application
configure do
register Sinatra::ConfigFile
config_file ['./config.yml', './db.yml']
register Sinatra::SimpleNavigation
# setup the tmp dir where the generated fonts go
tmp_dir = "/tmp/metaflop"
FileUtils.rm_rf(tmp_dir)
Dir.mkdir(tmp_dir)
require './views/layout'
register Mustache::Sinatra
set :mustache, {
:views => './views',
:templates => './views'
}
mime_type :otf, 'font/opentype'
enable :sessions
# db
DataMapper.setup(:default, {
:adapter => settings.db[:adapter],
:host => settings.db[:host],
:username => settings.db[:username],
:password => settings.db[:password],
:database => settings.db[:database]
})
DataMapper.finalize
Url.auto_upgrade!
end
configure :development do
register Sinatra::Reloader
also_reload '**/*.rb'
dont_reload '**/*spec.rb'
end
configure :production do
# logging
log_dir = "log/rack/"
Dir.mkdir(log_dir) unless Dir.exist? log_dir
logger = File.new("#{log_dir}#{Time.new.iso8601}.log", 'w+')
$stderr.reopen(logger)
$stdout.reopen(logger)
end
before do
@main_navigation = render_navigation :context => :main
@meta_navigation = render_navigation :context => :meta
end
get '/' do
mustache :news
end
get '/modulator' do
mf = mf_instance_from_request
@font_parameters = mf.font_parameters
@active_fontface = mf.font_settings.fontface
mustache :modulator
end
# creates a shortened url for the current params (i.e. font setting)
get '/modulator/font/create' do
Url.create(:params => params)[:short]
end
get '/modulator/font/:url' do |url|
url = Url.first(:short => url)
if url.nil?
redirect '/'
end
mf = mf_instance_from_request url[:params]
@font_parameters = mf.font_parameters
@active_fontface = mf.font_settings.fontface
mustache :modulator
end
# redirect for legacy short urls
get '/font/:url' do |url|
redirect to "/modulator/font/#{url}"
end
get '/assets/css/:name.scss' do |name|
require './views/scss/bourbon/lib/bourbon.rb'
content_type :css
scss name.to_sym, :layout => false
end
get '/modulator/preview/:type' do |type|
mf = mf_instance_from_request
method = "preview_#{type}"
if mf.respond_to? method
image = mf.method(method).call
[image ? 200 : 404, { 'Content-Type' => 'image/gif' }, image]
else
not_found "The preview type could not be found"
end
end
get '/modulator/export/font/:type/:face/:hash' do |type, face, hash|
mf = Metaflop.new({ :out_dir => out_dir, :font_hash => hash, :fontface => face })
mf.settings = settings.metaflop
mf.logger = logger
method = "font_#{type}"
if mf.respond_to? method
file = mf.method(method).call
attachment file[:name]
file[:data]
else
not_found "The font type is not supported"
end
end
get '/:page/partial' do |page|
mf = mf_instance_from_request
@font_parameters = mf.font_parameters
@active_fontface = mf.font_settings.fontface
mustache page.to_sym, :layout => false
end
get '/:page/?:subpage?' do |page, subpage|
if settings.respond_to? page
@settings = settings.method(page).call
end
unless subpage.nil?
@subpage = subpage
end
mustache page.to_sym
end
def out_dir
session[:id] ||= SecureRandom.urlsafe_base64
"/tmp/metaflop/#{session[:id]}"
end
def mf_instance_from_request(params = params)
# map all query params
args = { :out_dir => out_dir }
(FontParameters::VALID_PARAMETERS_KEYS + FontSettings::VALID_OPTIONS_KEYS).each do |key|
# query params come in with dashes -> replace by underscores to match properties
value = params[key.to_s.gsub("_", "-")]
# whitelist allowed characters
args[key] = value.delete "^a-zA-Z0-9., " if value && !value.empty?
end
mf = Metaflop.new(args)
mf.settings = settings.metaflop
mf.logger = logger
mf
end
end
This diff is collapsed.
Copyright (c) {{year}}, Metaflop (http://www.metaflop.com),
Copyright (c) {{year}}, Simon Egli,
Copyright (c) {{year}}, Marco Mueller,
Copyright (c) {{year}}, Alexis Reigel,
with Reserved Font Name {{fontface}}.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
This diff is collapsed.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Metaflop @font-face sample</title>
<style type="text/css">
@font-face {
font-family: '{{fontface}}-{{font_hash}}';
src: url('{{fontface}}-{{font_hash}}.eot');
src: url('{{fontface}}-{{font_hash}}.eot?#iefix') format('embedded-opentype'),
url('{{fontface}}-{{font_hash}}.woff') format('woff'),
url('{{fontface}}-{{font_hash}}.ttf') format('truetype'),
url('{{fontface}}-{{font_hash}}.svg#{{fontface}}-{{font_hash}}') format('svg');
}
body {
font-family:'{{fontface}}-{{font_hash}}';
padding: 10px 0;
}
h1 {
margin: 0;
font-size: 48px;
font-weight: normal;
}
h2 {
margin: 0;
position: absolute;
top: 0;
right: 10px;
font-weight: normal;
}
dl {
position: relative;
line-height: 1;
margin: 0 0 20px 0;
}
dt {
position: absolute;
font-size: 10px;
}
dt span {
position: absolute;
bottom: 17%;
}
dd {
margin: 0 0 0 40px;
}
a, a:visited, a:active, a:hover {
font-size: 12px;
text-decoration: none;
color: #000;
}
a:hover {
color: #ff0000;
}
#main {
width: 860px;
margin: 0 auto;
padding: 20px 10px;
position: relative;
background: #d7ffff;
}
header, section {
margin: 0 0 40px 0;
}
section header {
margin: 0 0 10px 0;
font-size: 12px;
}
section header span {
color: #ff0000;
}
#samples dd {
line-height: 1.4em;
}
{{#all_sizes}}
.size-{{.}} dd {
font-size: {{.}}px;
}
.size-{{.}} dt {
height: {{.}}px;
}
{{/all_sizes}}
.uppercase {
text-transform: uppercase;
}
.last {
margin-bottom: 0;
}
</style>
</head>
<body>
<div id="main">
<header>
<hgroup>
<h1>{{fontface}}-{{font_hash}}</h1>
<h2><a href="http://www.metaflop.com">www.metaflop.com</a></h2>
</hgroup>
</header>
<section id="specimen">
<header><span>size</span> - css font-size (px)</header>
{{#specimen_sizes}}
<dl class="size-{{.}} uppercase">
<dt><span>{{.}}</span></dt>
<dd>Our life is frittered</dd>
</dl>
{{/specimen_sizes}}
{{#specimen_sizes}}
<dl class="size-{{.}}">