Estilo fontSizeAdjust Property
Ejemplo
Ajustar tamaño de fuente:
document.getElementById("demo").style.fontSizeAdjust = "0.58";
Definición y uso
La propiedad fontSizeAdjust establece o devuelve el valor de aspecto de fuente de un texto.
Todas las fuentes tienen un valor de aspecto que es la diferencia de tamaño entre la letra minúscula "x" y la letra mayúscula "X".
La propiedad fontSizeAdjust le brinda un mejor control del tamaño de fuente cuando la fuente de primera elección no está disponible. Cuando una fuente no está disponible, el navegador usa la segunda fuente especificada. Esto podría resultar en un gran cambio para el tamaño de fuente. Para evitar esto, utilice esta propiedad.
Cuando el navegador conoce el valor de aspecto para la fuente de primera elección, el navegador puede averiguar qué tamaño de fuente usar al mostrar texto con la fuente de segunda elección.
Compatibilidad con navegador
Property | |||||
---|---|---|---|---|---|
fontSizeAdjust | Not supported | Not supported | Yes | Not supported | Not supported |
Sintaxis
Devuelve la propiedad fontSizeAdjust:
object.style.fontSizeAdjust
Establezca la propiedad fontSizeAdjust:
object.style.fontSizeAdjust = "none|number|initial|inherit"
Value | Description |
---|---|
none | Default value. No font size adjustment |
number | Preserve the first-choice font's x-height, and calculate the aspect value ratio for the font. The formula that is used: font-size of first-choice font*(aspect value of first-choice font/aspect value of available font)=font-size to use on available font Example: If 14px Verdana (aspect value of 0.58) was unavailable, but the available font, Times New Roman, has an aspect value of 0.46, the adjusted font-size to use would be 14*(0.58/0.46) = 17.65px. |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Detalles técnicos
Valor por defecto: | ninguna |
---|---|
Valor de retorno: | Una cadena, que representa el valor de aspecto de fuente de un texto |
Versión CSS | CSS3 |
páginas relacionadas
Tutorial de CSS: fuente CSS
Referencia CSS: propiedad de tamaño de fuente
Referencia HTML DOM: propiedad de fuente
❮ Objeto de estilo