helgodoy Posted March 2, 2005 Report Share Posted March 2, 2005 será que alguém pode me ajudar...relatório com dois tamanhos de font. Obrigado. Quote Link to comment Share on other sites More sharing options...
bluesman Posted March 2, 2005 Report Share Posted March 2, 2005 o godoy: ja ajudei um pessoal ai com negocio de fonte para varios tamanhos, dai repito a funçao que ja postei aqui, em versão mais aperfeicoada ainda : /* FUN€AO DESENHADA POR ERIC CLAPTON E B.B. KING FUNCAO PARA ESCOLHER QUAL O TAMANHO DE FONTE ADEQUADO PARA A FONTE ESCOLHIDA, IMPRESSORA ESCOLHIDA E QUANTOS CARACTERES O USUARIO QUER NA LINHA, NA HORIZONTAL TOTALMENTE INDEPENDENTE DO TIPO, MARCA E RESOLUCAO DA PRINTER !! Parametros : oPrn -> objeto da impressao font_name -> adivinha... nCaractLine -> quantos carateres na linha horizontal Retorna : oFont -> objeto da fonte apropriada deltapx -> quantos pixel tem que avancar cada linha de impressao gráfica para se ter 6 linhas por polegada, isso ‚ pra ser usado somente se nÆo quizer juntar a linhas, quando a fonte for muito pequena, senao o relatorio fica "inl¡vel" !!! Padrao manjado de 6 lines/inch nLinesPage -> quantas linhas vai caber por pagina se avan‡ar usando deltapx */ ********************************************* function pick_font(oPrn,font_name,nCaractLine,vertical,bold) ********************************************* local oFont,size,deltapx,nCaract,nLinesPage if valtype(bold) # "L" bold := .F. endif if valtype(vertical) # "L" vertical := .t. endif for size := 20 to 100 step .01 oFont := TFont():New( font_name, 0, -1 * size ,.f.,bold,,,,,,,,,,, ) if valtype(oFont) # "O" return { NIL , 0 , 0 } endif if vertical nCaract := int ( 0.725 * oPrn:nHorzRes() / oFont:nWidth ) else nCaract := int ( 0.725 * oPrn:nVertRes() / oFont:nWidth ) endif // achou um tamanho que serve !! - sai fora !! if nCaract <= nCaractLine exit endif oFont:End() next // TENTOU 200 VEZES E NADA !!!!!!!!! // DEVE SER IMPRESSORA DE IMPRIMIR LOGOTIPO EM NEURONIO DE AMEBA !! if valtype(oFont) # "O" return { NIL , 0 , 0 } endif if vertical // avanco vertical padrao desejado em pixel nLinesPage := int ( oPrn:nVertSize() / ( 25.4 / 6 ) ) deltapx := oPrn:nVertRes() / nLinesPage if oFont:nHeight + 3 > deltapx && FONTE FICOU MUITO GRANDE !!!!! deltapx := oFont:nHeight + 3 nLinesPage := int ( oPrn:nVertSize() / deltapx ) endif else // avanco vertical padrao desejado em pixel nLinesPage := int ( oPrn:nHorzSize() / ( 25.4 / 6 ) ) deltapx := oPrn:nHorzRes() / nLinesPage if oFont:nHeight + 3 > deltapx && FONTE FICOU MUITO GRANDE !!!!! deltapx := oFont:nHeight + 3 nLinesPage := int ( oPrn:nHorzSize() / deltapx ) endif endif return {oFont,deltapx,nLinesPage} ABRAÇAO ESSA RESOLVE EU GARANTO BM FW1.92+Clipper 5.3+Lib+Blinker+BC++ Editado por - bluesman on 02/03/2005 17:50:59 Quote Link to comment Share on other sites More sharing options...
vagner Posted March 2, 2005 Report Share Posted March 2, 2005 Ola Helgodoy, Seja muito bem vindo ao forum Vagner Wirts Clipper 5.2 Lib 5.3 - Blinker 5.0 FW 2.0, Harbour 43.0 (Flex), xHarbour 99.1 99.2 99.3 (Simplex) FW 2.5 Quote Link to comment Share on other sites More sharing options...
rmarins Posted March 2, 2005 Report Share Posted March 2, 2005 Definindo: DEFINE FONT oFONT NAME "COURIER NEW" SIZE 0, -10 OF oPrn DEFINE FONT oFONT1 NAME "COURIER NEW" SIZE 0, -8 OF oPrn DEFINE FONT oFONT2 NAME "COURIER NEW" SIZE 0, -10 OF oPrn BOLD Imprimindo: oPRN:SAY(nROW*nLINHA,nCOL*7,"PRODUTO",oFONT) oPRN:SAY(nROW*nLINHA,nCOL*87," QUANTIDADE",oFONT1) oPRN:SAY(nROW*nLINHA,nCOL*100," VALOR",oFONT2) Abraços... Ronaldo Marins Rio de Janeiro - RJ Quote Link to comment Share on other sites More sharing options...
gabrielfast Posted March 2, 2005 Report Share Posted March 2, 2005 cara..desculpa a ignorancia..mais o q eh o Objeto da Impressão? =$ atenciosamente gabriel gasurf@terra.com.br Quote Link to comment Share on other sites More sharing options...
rmarins Posted March 3, 2005 Report Share Posted March 3, 2005 Criando: PRINT oPRN NAME OEMTOANSI("TÃtulo") PREVIEW oPRN:SETPORTRAIT() Abraços.... Ronaldo Marins Rio de Janeiro - RJ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.