Ver Mensaje Individual
  #2 (permalink)  
Antiguo 26/06/2012, 16:52
Avatar de walote
walote
 
Fecha de Ingreso: junio-2012
Ubicación: Argentina
Mensajes: 5
Antigüedad: 11 años, 10 meses
Puntos: 0
Respuesta: Tamaño de Fuentes para Impresora en Api de Windows

La declaración de la funcion:

CDC* CFunciones::OnTipoLetra(CDC* pDC, CString Tipo, int Height, int Weight)
{
LOGFONT lf;
CFont fuente;
CFont *pFuenteAnterior = NULL;

memset( &lf, 0, sizeof(LOGFONT) );
lf.lfHeight = Height;
lf.lfWeight = Weight;
strcpy(lf.lfFaceName, Tipo);

if( fuente.CreateFontIndirect( &lf ) )
pFuenteAnterior = pDC->SelectObject( &fuente );

return pDC;
}

La implementación:

CDC* pDC;

pDC = OnTipoLetra(pDC, "Arial", 20, 90); //20 = tamaño - 90 = espesor

Saludos!