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.
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.
<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>
<canvas id="canvas_id"></canvas>
var font= new AdapType({
fonte1: 'fonts/Condensed.ttf',
fonte2: 'fonts/Expanded.ttf',
textToRender: "AdapType",
canvasID : "canvas_id"
)};
font.runAdapType();