FontFamily.GetEmHeight(FontStyle) Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Obtiene el alto, en unidades de diseño de fuente, del cuadrado em para el estilo especificado.
public:
int GetEmHeight(System::Drawing::FontStyle style);
public int GetEmHeight (System.Drawing.FontStyle style);
member this.GetEmHeight : System.Drawing.FontStyle -> int
Public Function GetEmHeight (style As FontStyle) As Integer
Parámetros
Devoluciones
Alto de la plaza em.
Ejemplos
El ejemplo de código siguiente está diseñado para su uso con Windows Forms y requiere PaintEventArgse
, que es un parámetro del controlador de eventos Paint. El código realiza las siguientes acciones:
Crea un FontFamily.
Obtiene el alto cuadrado em para esa familia de fuentes.
Dibuja el valor de la altura em en la pantalla como texto.
public:
void GetEmHeight_Example( PaintEventArgs^ e )
{
// Create a FontFamily object.
FontFamily^ emFontFamily = gcnew FontFamily( "arial" );
// Get the em height of the font family in design units.
int emHeight = emFontFamily->GetEmHeight( FontStyle::Regular );
// Draw the result as a string to the screen.
e->Graphics->DrawString( String::Format( "emFontFamily.GetEmHeight() returns {0}.", emHeight ),
gcnew System::Drawing::Font( emFontFamily,16 ), Brushes::Black, PointF(0,0) );
}
public void GetEmHeight_Example(PaintEventArgs e)
{
// Create a FontFamily object.
FontFamily emFontFamily = new FontFamily("arial");
// Get the em height of the font family in design units.
int emHeight = emFontFamily.GetEmHeight(FontStyle.Regular);
// Draw the result as a string to the screen.
e.Graphics.DrawString(
"emFontFamily.GetEmHeight() returns " + emHeight.ToString() + ".",
new Font(emFontFamily, 16),
Brushes.Black,
new PointF(0, 0));
}
Public Sub GetEmHeight_Example(ByVal e As PaintEventArgs)
' Create a FontFamily object.
Dim emFontFamily As New FontFamily("arial")
' Get the em height of the font family in design units.
Dim emHeight As Integer = _
emFontFamily.GetEmHeight(FontStyle.Regular)
' Draw the result as a string to the screen.
e.Graphics.DrawString("emFontFamily.GetEmHeight() returns " & _
emHeight.ToString() + ".", New Font(emFontFamily, 16), _
Brushes.Black, New PointF(0, 0))
End Sub
Comentarios
Em square es un término tipográfico que hace referencia al rectángulo ocupado por la letra más ancha de la fuente, tradicionalmente la letra M.
Se aplica a
Consulte también
Comentarios
https://aka.ms/ContentUserFeedback.
Próximamente: A lo largo de 2024 iremos eliminando gradualmente GitHub Issues como mecanismo de comentarios sobre el contenido y lo sustituiremos por un nuevo sistema de comentarios. Para más información, vea:Enviar y ver comentarios de