About

AdapType is a project thought as part of the Master's degree in Design and Multimedia at the University of Coimbra, Portugal. With the help of mentors Artur Rebelo and Luis Lucas Pereira and the support of family and friends.

AdapType is a script that allows any font width to respond to the window size. For this, it needs TWO font files, to make the stretch possible, since each master indicates the minimum and maximum width the font can take.

With this, the script can generate any width of the font and draws it, in the canvas.

This script uses jQuery and opentype.js, which allows to read a font data and change it. Some functions were added to opentype.js, so the AdapType would be possible.

masters
Compatible Fonts

For the development of this project I needed a typeface that would suffer the stretch by the script.

To carry out the proposed idea, an extra large version of each font was created to make its stretch possible.

Reglo

ABCDEFGHIJKLMNOPQRSTUVWYXZabcdefghijklmnopqrstuvwyxz

Get Original Download Adaptation

Arvo

ABCDEFGHIJKLMNOPQRSTUVWYXZabcdefghijklmnopqrstuvwyxz

Get Original In Development
Inspiration
Process
How to use

1. Include JQuery, Opentype.js and AdapType.js

<script type="text/javascript" src="PATH_TO/jquery.min.js"></script>
<script type="text/javascript" src="PATH_TO/opentype_modified.min.js"></script>
<script type="text/javascript" src="PATH_TO/AdapType.min.js"></script>

2. Create canvas

<canvas id="canvas_id"></canvas>

3. Initialize AdapType, indicating font to stretch and place to draw

var font= new AdapType({
    fonte1: 'fonts/Condensed.ttf',
    fonte2: 'fonts/Expanded.ttf',
    textToRender: "AdapType",
    canvasID : "canvas_id"
)};

4. Run AdapType

font.runAdapType();

Options
Option
Default
Type
Description
fontSize
100
number
Defines size of font to draw.
mode
equal
string
Defines what mode each letter will be stretched:
random
,
equal
,
firstLetter
,
lastLetter
,
chosenLetter
,
deform.
chosenLetters
null
array
Defines witch letter will be stretched, in mode
chosenLetter
.
canvasID
null
string
Link to canvas to draw.
canvasWidth
100
number
Indicates percentage of window to canvas use.
canvasWidthMode
percentage
string
Indicates the type of measure of canvas width,
percentage
,
pixels
.
color
black
string
Color to fill font.
stroke
transparent
string
Indicates the stroke color.
strokeWidth
0
number
Indicates the stroke width.
animateonEnter
false
boolean
Animate font stretch, when window is loaded.
start
max
string
Where the stretch will start, with its
max
value or
min
.
Demo

Text

Mode

Letter to Change

220

Font Size

80

Canvas Width

0

Stroke

Fill

Stroke

Animate