Skip to content

Text adjustments #7523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/core/p5.Renderer2D.js
Original file line number Diff line number Diff line change
Expand Up @@ -1030,12 +1030,12 @@ class Renderer2D extends Renderer {
}

//////////////////////////////////////////////
// TYPOGRAPHY
// TYPOGRAPHY (see src/type/textCore.js)
//
//////////////////////////////////////////////



/*
_renderText(p, line, x, y, maxY, minY) {
if (y < minY || y >= maxY) {
return; // don't render lines beyond our minY/maxY bounds (see #5785)
Expand Down Expand Up @@ -1100,7 +1100,7 @@ class Renderer2D extends Renderer {
return p;
}

/*_applyTextProperties() {
_applyTextProperties() {
let font;
const p = this._pInst;

Expand Down
4 changes: 2 additions & 2 deletions src/type/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

import text2d from './text2d.js';
import textCore from './textCore.js';
import p5font from './p5.Font.js';

export default function(p5){
p5.registerAddon(text2d);
p5.registerAddon(textCore);
p5.registerAddon(p5font);
}

8 changes: 4 additions & 4 deletions src/type/text2d.js → src/type/textCore.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { Renderer } from '../core/p5.Renderer';

/**
* @module Type
* @submodule text2d
* @submodule textCore
* @for p5
* @requires core
*/
function text2d(p5, fn) {
function textCore(p5, fn) {

// additional constants
fn.IDEOGRAPHIC = 'ideographic';
Expand Down Expand Up @@ -1255,8 +1255,8 @@ function text2d(p5, fn) {
}
}

export default text2d;
export default textCore;

if (typeof p5 !== 'undefined') {
text2d(p5, p5.prototype);
textCore(p5, p5.prototype);
}