Enum FontFamily
Familia de fuentes
Obsoleto. Los métodos getFontFamily()
y setFontFamily(String)
ahora usan nombres de cadenas para las fuentes en lugar de esta enumeración. Aunque esta enumeración dejó de estar disponible, seguirá disponible para brindar compatibilidad con secuencias de comandos anteriores.
Es una enumeración de las fuentes compatibles.
Usa la enumeración FontFamily
para establecer la fuente de un rango de texto, elemento o
documento.
const body =
DocumentApp.getActiveDocument().getActiveTab().asDocumentTab().getBody();
// Insert a paragraph at the start of the document.
body.insertParagraph(0, 'Hello, Apps Script!');
// Set the tab font to Calibri.
body.editAsText().setFontFamily(DocumentApp.FontFamily.CALIBRI);
// Set the first paragraph font to Arial.
body.getParagraphs()[0].setFontFamily(DocumentApp.FontFamily.ARIAL);
// Set "Apps Script" to Comic Sans MS.
const text = 'Apps Script';
const a = body.getText().indexOf(text);
const b = a + text.length - 1;
body.editAsText().setFontFamily(a, b, DocumentApp.FontFamily.COMIC_SANS_MS);
Propiedades obsoletas
Propiedad | Tipo | Descripción |
AMARANTH | Enum | La familia de fuentes Amaranth. |
ARIAL | Enum | La familia de fuentes Arial. |
ARIAL_BLACK | Enum | La familia de fuentes Arial Black. |
ARIAL_NARROW | Enum | La familia de fuentes Arial Narrow. |
ARVO | Enum | La familia de fuentes Arvo. |
CALIBRI | Enum | La familia de fuentes Calibri. |
CAMBRIA | Enum | La familia de fuentes Cambria. |
COMIC_SANS_MS | Enum | La familia de fuentes Comic Sans MS. |
CONSOLAS | Enum | La familia de fuentes Consolas. |
CORSIVA | Enum | La familia de fuentes Corsiva. |
COURIER_NEW | Enum | La familia de fuentes Courier New. |
DANCING_SCRIPT | Enum | La familia de fuentes Dancing Script. |
DROID_SANS | Enum | La familia de fuentes Droid Sans. |
DROID_SERIF | Enum | La familia de fuentes Droid Serif. |
GARAMOND | Enum | La familia de fuentes Garamond. |
GEORGIA | Enum | La familia de fuentes Georgia. |
GLORIA_HALLELUJAH | Enum | La familia de fuentes Gloria Hallelujah. |
GREAT_VIBES | Enum | La familia de fuentes Great Vibes. |
LOBSTER | Enum | La familia de fuentes Lobster. |
MERRIWEATHER | Enum | La familia de fuentes Merriweather. |
PACIFICO | Enum | La familia de fuentes Pacifico |
PHILOSOPHER | Enum | La familia de fuentes Philosopher. |
POIRET_ONE | Enum | La familia de fuentes Poiret One |
QUATTROCENTO | Enum | La familia de fuentes Quattrocento. |
ROBOTO | Enum | La familia de fuentes Roboto |
SHADOWS_INTO_LIGHT | Enum | La familia de fuentes Shadows Into Light. |
SYNCOPATE | Enum | La familia de fuentes Syncopate. |
TAHOMA | Enum | La familia de fuentes Tahoma. |
TIMES_NEW_ROMAN | Enum | La familia de fuentes Times New Roman. |
TREBUCHET_MS | Enum | La familia de fuentes Trebuchet MS. |
UBUNTU | Enum | La familia de fuentes de Ubuntu. |
VERDANA | Enum | La familia de fuentes Verdana. |
Salvo que se indique lo contrario, el contenido de esta página está sujeto a la licencia Atribución 4.0 de Creative Commons, y los ejemplos de código están sujetos a la licencia Apache 2.0. Para obtener más información, consulta las políticas del sitio de Google Developers. Java es una marca registrada de Oracle o sus afiliados.
Última actualización: 2024-12-22 (UTC)
[null,null,["Última actualización: 2024-12-22 (UTC)"],[[["`FontFamily` is deprecated and now uses string names for fonts instead of the enum, but remains for compatibility."],["This enum allows you to set the font for text ranges, elements, or entire Google Docs documents."],["Supported fonts include Arial, Calibri, Comic Sans MS, Times New Roman, Verdana, and many more."],["You can use methods like `setFontFamily()` within Google Apps Script to apply these fonts."]]],[]]