textMode()

本参考资料用于Processing 3.0+。 如果你使用的是前一版本,请在使用软件帮助菜单内的参考资料。. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Core Javadoc and Libraries Javadoc.

名称

textMode()

示例
 import processing.pdf.*;



void setup()
{  
size(500, 500, PDF, "TypeDemo.pdf");


textMode(SHAPE);


textSize(180);


  } 
void draw()
{  
text("ABC", 75, 350);


exit();

// Quit the program
  } 
描述 Sets the way text draws to the screen, either as texture maps or as vector geometry. The default textMode(MODEL), uses textures to render the fonts. The textMode(SHAPE) mode draws text using the glyph outlines of individual characters rather than as textures. This mode is only supported with the PDF and P3D renderer settings. With the PDF renderer, you must call textMode(SHAPE) before any other drawing occurs. If the outlines are not available, then textMode(SHAPE) will be ignored and textMode(MODEL) will be used instead.

The textMode(SHAPE) option in P3D can be combined with beginRaw() to write vector-accurate text to 2D and 3D output files, for instance DXF or PDF. The SHAPE mode is not currently optimized for P3D, so if recording shape data, use textMode(MODEL) until you’re ready to capture the geometry with beginRaw().

语法
textMode(mode)
参数
mode int: either MODEL or SHAPE
返回值 void
相关 loadFont()
text()
textFont()
beginRaw()
createFont()

Updated on October 2, 2018 05:02:09pm EDT

textMode()