Texto
Inheritance: java.lang.Object, com.aspose.threed.A3DObject, com.aspose.threed.SceneObject, com.aspose.threed.Entity, com.aspose.threed.Profile
public class Text extends Profile
Perfil de texto, este perfil describe contornos usando fuente y texto. Ejemplo: El siguiente código muestra cómo crear una malla 3D a partir de texto usando el archivo de fuente especificado.
var font = FontFile.fromFile("CascadiaCode-Regular.otf");
var text = new Text();
text.setFont(font);
text.setContent("ABC");
text.setFontSize(10);
var linear = new LinearExtrusion(text, 10).toMesh();
var scene = new Scene(linear);
scene.save("test.stl");
Constructores
| Constructor | Descripción |
|---|---|
| Text() |
Métodos
| Método | Descripción |
|---|---|
| equals(Object arg0) | |
| findProperty(String propertyName) | Busca la propiedad. |
| getBoundingBox() | Obtiene el cuadro delimitador de la entidad actual en su sistema de coordenadas de espacio de objetos. |
| getClass() | |
| getContent() | Contenido del texto |
| getEntityRendererKey() | Obtiene la clave del renderizador de entidad registrado en el renderizador |
| getExcluded() | Obtiene si se debe excluir esta entidad durante la exportación. |
| getFont() | La fuente del texto. |
| getFontSize() | Escala del tamaño de la fuente. |
| getName() | Obtiene el nombre. |
| getParentNode() | Obtiene el primer nodo padre; si se establece el primer nodo padre, esta entidad se separará de los demás nodos padres. |
| getParentNodes() | Obtiene todos los nodos padres; una entidad puede estar adjunta a varios nodos padres para instanciación de geometría. |
| getProperties() | Obtiene la colección de todas las propiedades. |
| getProperty(String property) | Obtiene el valor de la propiedad especificada |
| getScene() | Obtiene la escena a la que pertenece este objeto. |
| hashCode() | |
| notify() | |
| notifyAll() | |
| removeProperty(Property property) | Elimina una propiedad dinámica. |
| removeProperty(String property) | Elimina la propiedad especificada identificada por nombre. |
| setContent(String value) | Contenido del texto |
| setExcluded(boolean value) | Establece si se debe excluir esta entidad durante la exportación. |
| setFont(FontFile value) | La fuente del texto. |
| setFontSize(float value) | Escala del tamaño de la fuente. |
| setName(String value) | Establece el nombre. |
| setParentNode(Node value) | Establece el primer nodo padre; si se establece el primer nodo padre, esta entidad se separará de los demás nodos padres. |
| setProperty(String property, Object value) | Establece el valor de la propiedad especificada. |
| toString() | |
| wait() | |
| wait(long arg0) | |
| wait(long arg0, int arg1) |
Text()
public Text()
equals(Object arg0)
public boolean equals(Object arg0)
Parameters:
| Parámetro | Tipo | Descripción |
|---|---|---|
| arg0 | java.lang.Object |
Returns: boolean
findProperty(String propertyName)
public Property findProperty(String propertyName)
Busca la propiedad. Puede ser una propiedad dinámica (Creada por CreateDynamicProperty/SetProperty) o una propiedad nativa (Identificada por su nombre)
Parameters:
| Parámetro | Tipo | Descripción |
|---|---|---|
| propertyName | java.lang.String | Nombre de la propiedad. |
Returns: Property - The property.
getBoundingBox()
public BoundingBox getBoundingBox()
Obtiene el cuadro delimitador de la entidad actual en su sistema de coordenadas de espacio de objetos.
Returns: BoundingBox - the bounding box of current entity in its object space coordinate system. Example: The following code shows how to calculate the bounding box of a shape
Entity entity = new Sphere();
entity.setRadius(10);
var bbox = entity.getBoundingBox();
System.out.printf("The bounding box of the entity is %s ~ %s", bbox.getMinimum(), bbox.getMaximum());
getClass()
public final native Class<?> getClass()
Returns: java.lang.Class
getContent()
public String getContent()
Contenido del texto
Returns: java.lang.String - Contenido del texto Ejemplo: El siguiente código muestra cómo crear una malla 3D a partir de texto usando el archivo de fuente especificado.
var font = FontFile.fromFile("CascadiaCode-Regular.otf");
var text = new Text();
text.setFont(font);
text.setContent("ABC");
text.setFontSize(10);
var linear = new LinearExtrusion(text, 10).toMesh();
var scene = new Scene(linear);
scene.save("test.stl");
getEntityRendererKey()
public EntityRendererKey getEntityRendererKey()
Obtiene la clave del renderizador de entidad registrado en el renderizador
Returns: EntityRendererKey
getExcluded()
public boolean getExcluded()
Obtiene si se debe excluir esta entidad durante la exportación.
Returns: boolean - si se debe excluir esta entidad durante la exportación.
getFont()
public FontFile getFont()
La fuente del texto.
Returns: FontFile - The font of the text. Example: The following code shows how to create a 3D mesh from text using specified font file.
var font = FontFile.fromFile("CascadiaCode-Regular.otf");
var text = new Text();
text.setFont(font);
text.setContent("ABC");
text.setFontSize(10);
var linear = new LinearExtrusion(text, 10).toMesh();
var scene = new Scene(linear);
scene.save("test.stl");
getFontSize()
public float getFontSize()
Escala del tamaño de la fuente.
Returns: float - Escala del tamaño de la fuente. Ejemplo: El siguiente código muestra cómo crear una malla 3D a partir de texto usando el archivo de fuente especificado.
var font = FontFile.fromFile("CascadiaCode-Regular.otf");
var text = new Text();
text.setFont(font);
text.setContent("ABC");
text.setFontSize(10);
var linear = new LinearExtrusion(text, 10).toMesh();
var scene = new Scene(linear);
scene.save("test.stl");
getName()
public String getName()
Obtiene el nombre.
Returns: java.lang.String - el nombre.
getParentNode()
public Node getParentNode()
Obtiene el primer nodo padre; si se establece el primer nodo padre, esta entidad se separará de los demás nodos padres.
Returns: Node - the first parent node, if set the first parent node, this entity will be detached from other parent nodes.
getParentNodes()
public ArrayList<Node> getParentNodes()
Obtiene todos los nodos padres; una entidad puede estar adjunta a varios nodos padres para instanciación de geometría.
Returns: java.util.ArrayList<com.aspose.threed.Node> - todos los nodos padre, una entidad puede estar adjunta a varios nodos padre para instanciación de geometría
getProperties()
public PropertyCollection getProperties()
Obtiene la colección de todas las propiedades.
Returns: PropertyCollection - the collection of all properties.
getProperty(String property)
public Object getProperty(String property)
Obtiene el valor de la propiedad especificada
Parameters:
| Parámetro | Tipo | Descripción |
|---|---|---|
| propiedad | java.lang.String | Nombre de la propiedad |
Returns: java.lang.Object - El valor de la propiedad encontrada
getScene()
public Scene getScene()
Obtiene la escena a la que pertenece este objeto.
Returns: Scene - the scene that this object belongs to
hashCode()
public native int hashCode()
Returns: int
notify()
public final native void notify()
notifyAll()
public final native void notifyAll()
removeProperty(Property property)
public boolean removeProperty(Property property)
Elimina una propiedad dinámica.
Parameters:
| Parámetro | Tipo | Descripción |
|---|---|---|
| property | Property | Qué propiedad eliminar |
Returns: boolean - verdadero si la propiedad se elimina correctamente
removeProperty(String property)
public boolean removeProperty(String property)
Elimina la propiedad especificada identificada por nombre.
Parameters:
| Parámetro | Tipo | Descripción |
|---|---|---|
| propiedad | java.lang.String | Qué propiedad eliminar |
Returns: boolean - verdadero si la propiedad se elimina correctamente
setContent(String value)
public void setContent(String value)
Contenido del texto
Parameters:
| Parámetro | Tipo | Descripción |
|---|---|---|
| valor | java.lang.String |
var font = FontFile.fromFile("CascadiaCode-Regular.otf");
var text = new Text();
text.setFont(font);
text.setContent("ABC");
text.setFontSize(10);
var linear = new LinearExtrusion(text, 10).toMesh();
var scene = new Scene(linear);
scene.save("test.stl");
``` |
### setExcluded(boolean value) {#setExcluded-boolean-}
public void setExcluded(boolean value)
Establece si se debe excluir esta entidad durante la exportación.
**Parameters:**
| Parámetro | Tipo | Descripción |
| --- | --- | --- |
| valor | boolean | Nuevo valor |
### setFont(FontFile value) {#setFont-com.aspose.threed.FontFile-}
public void setFont(FontFile value)
La fuente del texto.
**Parameters:**
| Parámetro | Tipo | Descripción |
| --- | --- | --- |
| | value | [FontFile](../../com.aspose.threed/fontfile) | Nuevo valor **Ejemplo:** El siguiente código muestra cómo crear una malla 3D a partir de texto usando el archivo de fuente especificado. |
var font = FontFile.fromFile(“CascadiaCode-Regular.otf”); var text = new Text(); text.setFont(font); text.setContent(“ABC”); text.setFontSize(10); var linear = new LinearExtrusion(text, 10).toMesh(); var scene = new Scene(linear); scene.save(“test.stl”);
### setFontSize(float value) {#setFontSize-float-}
public void setFontSize(float value)
Escala del tamaño de la fuente.
**Parameters:**
| Parámetro | Tipo | Descripción |
| --- | --- | --- |
| | valor | float | Nuevo valor **Ejemplo:** El siguiente código muestra cómo crear una malla 3D a partir de texto usando el archivo de fuente especificado. |
var font = FontFile.fromFile(“CascadiaCode-Regular.otf”); var text = new Text(); text.setFont(font); text.setContent(“ABC”); text.setFontSize(10); var linear = new LinearExtrusion(text, 10).toMesh(); var scene = new Scene(linear); scene.save(“test.stl”);
### setName(String value) {#setName-java.lang.String-}
public void setName(String value)
Establece el nombre.
**Parameters:**
| Parámetro | Tipo | Descripción |
| --- | --- | --- |
| valor | java.lang.String | Nuevo valor |
### setParentNode(Node value) {#setParentNode-com.aspose.threed.Node-}
public void setParentNode(Node value)
Establece el primer nodo padre; si se establece el primer nodo padre, esta entidad se separará de los demás nodos padres.
**Parameters:**
| Parámetro | Tipo | Descripción |
| --- | --- | --- |
| value | [Node](../../com.aspose.threed/node) | Nuevo valor |
### setProperty(String property, Object value) {#setProperty-java.lang.String-java.lang.Object-}
public void setProperty(String property, Object value)
Establece el valor de la propiedad especificada.
**Parameters:**
| Parámetro | Tipo | Descripción |
| --- | --- | --- |
| propiedad | java.lang.String | Nombre de la propiedad |
| valor | java.lang.Object | El valor de la propiedad |
### toString() {#toString--}
public String toString()
**Returns:**
java.lang.String
### wait() {#wait--}
public final void wait()
### wait(long arg0) {#wait-long-}
public final void wait(long arg0)
**Parameters:**
| Parámetro | Tipo | Descripción |
| --- | --- | --- |
| arg0 | long | |
### wait(long arg0, int arg1) {#wait-long-int-}
public final void wait(long arg0, int arg1)
**Parameters:**
| Parámetro | Tipo | Descripción |
| --- | --- | --- |
| arg0 | long | |
| arg1 | int | |