Skip to content

Commit 8fddc40

Browse files
authored
Merge pull request #5466 from processing/Issue#5462
Fix to Issue #5462
2 parents cf1365f + 6253e83 commit 8fddc40

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

src/typography/p5.Font.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ p5.Font.prototype.textToPoints = function(txt, x, y, fontSize, options) {
238238
function isSpace(i) {
239239
return (
240240
(glyphs[i].name && glyphs[i].name === 'space') ||
241-
(txt.length === glyphs.length && txt[i] === ' ') ||
242-
(glyphs[i].index && glyphs[i].index === 3)
241+
(txt.length === glyphs.length && txt[i] === ' ') //||
242+
//(glyphs[i].index && glyphs[i].index === 3)
243243
);
244244
}
245245

test/manual-test-examples/p5.Font/opentype/sketch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var font;
22
var snapDistance = 71;
33

44
function preload() {
5-
font = loadFont('inconsolata.otf');
5+
font = loadFont('AvenirNextLTPro-Demi.otf');
66
}
77

88
function setup() {

test/manual-test-examples/p5.Font/pathpoints/sketch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function setup() {
88

99
flock = new Flock();
1010

11-
loadFont('../opentype/inconsolata.otf', function(f) {
11+
loadFont('../opentype/AvenirNextLTPro-Demi.otf', function(f) {
1212
var points = f.textToPoints('p5.js', 80, 185, 150);
1313
for (var k = 0; k < points.length; k++) {
1414
flock.boids.push(new Boid(points[k]));

test/manual-test-examples/p5.Font/simple/sketch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ var textSketch1958 = function(p) {
8686
function textAsWords(words, x, y) {
8787
var tw,
8888
spaceW = p.textWidth(' ');
89-
console.log(spaceW);
89+
//console.log(spaceW);
9090
for (var i = 0; i < words.length; i++) {
9191
if (i !== 0) {
9292
tw = p.textWidth(words[i - 1]);

test/manual-test-examples/p5.Font/svgpath/sketch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function setup() {
1919
strokeWidth: 2,
2020
stroke: 'green'
2121
});
22-
console.log(pathTag);
22+
//console.log(pathTag);
2323

2424
// hit detection for canvas Path2D (cursor changes)
2525
canvas.onmousemove = function(e) {

test/manual-test-examples/p5.Font/textAsWords/sketch.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ function setup() {
1010
function textAsWords(words, x, y) {
1111
var tw,
1212
spaceW = textWidth(' ');
13-
console.log('space=' + spaceW);
13+
//console.log('space=' + spaceW);
1414
for (var i = 0; i < words.length; i++) {
1515
fill(0);
1616
noStroke();
1717
text(words[i], x, y);
1818
x += textWidth(words[i]);
19-
console.log(words[i] + '=' + x);
19+
//console.log(words[i] + '=' + x);
2020

2121
if (i < words.length - 1) {
2222
stroke(0);
@@ -36,7 +36,7 @@ function setup() {
3636

3737
textSize(20); // Case 1: Default font
3838
noStroke();
39-
console.log('default');
39+
//console.log('default');
4040
text(words, 20, 50);
4141
textAsWords(words.split(' '), 20, 80);
4242

@@ -45,7 +45,7 @@ function setup() {
4545

4646
textFont(font, 20); // Case 2: OpenSans
4747
noStroke();
48-
console.log('\np5/loaded');
48+
//console.log('\np5/loaded');
4949
text(words, 20, 120);
5050

5151
textAsWords(words.split(' '), 20, 150);
@@ -56,13 +56,13 @@ setTimeout(function() {
5656
function _textAsWords(ctx, font, text, x, y, fontSize) {
5757
var tw,
5858
spaceW = font.getAdvanceWidth(' ', fontSize);
59-
console.log('space=' + spaceW);
59+
//console.log('space=' + spaceW);
6060

6161
for (var i = 0; i < text.length; i++) {
6262
var pth = font.getPath(text[i], x, y, fontSize);
6363
pth.draw(ctx);
6464
x += font.getAdvanceWidth(text[i], fontSize);
65-
console.log(text[i] + '=' + x);
65+
//console.log(text[i] + '=' + x);
6666
if (i < text.length - 1) {
6767
ctx.strokeRect(x, y + 5, spaceW, -25);
6868
x += spaceW;
@@ -79,7 +79,7 @@ setTimeout(function() {
7979
if (err) throw 'Font could not be loaded: ' + err;
8080
var ctx = document.getElementById('defaultCanvas0').getContext('2d');
8181
font.getPath(words, 20, 190, 20).draw(ctx);
82-
console.log('\nopentype/loaded');
82+
//console.log('\nopentype/loaded');
8383
_textAsWords(ctx, font, words.split(' '), 20, 220, 20);
8484
});
8585
}, 100);

0 commit comments

Comments
 (0)