<commit_before>/**
 * @module Typography
 * @submodule Attributes
 * @for p5
 * @requires core
 * @requires constants
 */
define(function (require) {

  'use strict';

  var p5 = require('core');
  var constants = require('constants');

  p5.prototype._textLeading = 15;
  p5.prototype._textFont = 'sans-serif';
  p5.prototype._textSize = 12;
  p5.prototype._textStyle = constants.NORMAL;

  /**
   * Sets the current alignment for drawing text. The parameters LEFT, CENTER,
   * and RIGHT set the display characteristics of the letters in relation to
   * the values for the x and y parameters of the text() function. 
   * 
   * @method textAlign
   * @param {Number/Constant} a horizontal alignment, either LEFT,
   *                            CENTER, or RIGHT
   * @example
   * <div>
   * <code>
   * textSize(16);
   * textAlign(RIGHT);
   * text("ABCD", 50, 30);
   * textAlign(CENTER);
   * text("EFGH", 50, 50);
   * textAlign(LEFT);
   * text("IJKL", 50, 70);
   * </code>
   * </div>
   */
  p5.prototype.textAlign = function(a) {
    if (a === constants.LEFT ||
      a === constants.RIGHT ||
      a === constants.CENTER) {
      this.drawingContext.textAlign = a;
    }
  };

  /**
   * Calculates and returns the height of any character or text string.
   *
   * @method textHeight
   * @param {String} s the String of characters to measure
   * @example
   * <div>
   * <code>
   * background(0);
   * fill(255);
   * textSize(14);
   * s = "String.";
   * text(s, 10, 23);
   * console.log(textHeight(s));
   * </code>
   * </div>
   */
  p5.prototype.textHeight = function(s) {
    return this.drawingContext.measureText(s).height;
  };

  /**
   * Sets the spacing between lines of text in units of pixels. This
   * setting will be used in all subsequent calls to the text() function.
   *
   * @method textLeading
   * @param {Number} l the size in pixels for spacing between lines
   * @example
   * <div>
   * <code>
   * // Text to display. The "\n" is a "new line" character
   * lines = "L1\nL2\nL3";
   * textSize(12);
   * fill(0);  // Set fill to black
   * 
   * textLeading(10);  // Set leading to 10
   * text(lines, 10, 25);
   * 
   * textLeading(20);  // Set leading to 20
   * text(lines, 40, 25);
   * 
   * textLeading(30);  // Set leading to 30
   * text(lines, 70, 25);
   * </code>
   * </div>
   */
  p5.prototype.textLeading = function(l) {
    this._setProperty('_textLeading', l);
  };<commit_msg>Removed textHeight() because it's not present in Processing and would function in confusingly different ways than textWidth().<commit_after>/**
 * @module Typography
 * @submodule Attributes
 * @for p5
 * @requires core
 * @requires constants
 */
define(function (require) {

  'use strict';

  var p5 = require('core');
  var constants = require('constants');

  p5.prototype._textLeading = 15;
  p5.prototype._textFont = 'sans-serif';
  p5.prototype._textSize = 12;
  p5.prototype._textStyle = constants.NORMAL;

  /**
   * Sets the current alignment for drawing text. The parameters LEFT, CENTER,
   * and RIGHT set the display characteristics of the letters in relation to
   * the values for the x and y parameters of the text() function. 
   * 
   * @method textAlign
   * @param {Number/Constant} a horizontal alignment, either LEFT,
   *                            CENTER, or RIGHT
   * @example
   * <div>
   * <code>
   * textSize(16);
   * textAlign(RIGHT);
   * text("ABCD", 50, 30);
   * textAlign(CENTER);
   * text("EFGH", 50, 50);
   * textAlign(LEFT);
   * text("IJKL", 50, 70);
   * </code>
   * </div>
   */
  p5.prototype.textAlign = function(a) {
    if (a === constants.LEFT ||
      a === constants.RIGHT ||
      a === constants.CENTER) {
      this.drawingContext.textAlign = a;
    }
  };

  /**
   * Sets the spacing between lines of text in units of pixels. This
   * setting will be used in all subsequent calls to the text() function.
   *
   * @method textLeading
   * @param {Number} l the size in pixels for spacing between lines
   * @example
   * <div>
   * <code>
   * // Text to display. The "\n" is a "new line" character
   * lines = "L1\nL2\nL3";
   * textSize(12);
   * fill(0);  // Set fill to black
   * 
   * textLeading(10);  // Set leading to 10
   * text(lines, 10, 25);
   * 
   * textLeading(20);  // Set leading to 20
   * text(lines, 40, 25);
   * 
   * textLeading(30);  // Set leading to 30
   * text(lines, 70, 25);
   * </code>
   * </div>
   */
  p5.prototype.textLeading = function(l) {
    this._setProperty('_textLeading', l);
  };
{'fraction_non_alphanumeric': 0.14361350099272005, 'fraction_numerical': 0.027134348113831898, 'mean_word_length': 2.5984126984126985, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6585803', 'n_tokens_mistral': 1629, 'n_tokens_neox': 1499, 'n_words': 442}