MAMP2 Posted April 3, 2023 Report Share Posted April 3, 2023 Estou tentando usar as fontes do window do codigo de barras code128.ttf, code39r.ttf, BardoeFont.ttf, e nenhuma funciona alguem saber se tem que acrescentar alguma lib ou dll no projeto pra elas funcionarem? Quote Link to comment Share on other sites More sharing options...
kapiaba Posted April 3, 2023 Report Share Posted April 3, 2023 ué, você está usando o que para gerar os códigos de barras, BARLIB? HBZEBRA? seja mais específico. Abs; Quote Link to comment Share on other sites More sharing options...
MAMP2 Posted April 3, 2023 Author Report Share Posted April 3, 2023 BarcodeFont.ttf Quote Link to comment Share on other sites More sharing options...
MAMP2 Posted April 3, 2023 Author Report Share Posted April 3, 2023 nada estou usando a fonte do windows, LOCAL cFontBC:=alltrim(memvar->te_drive)+"\LBPremium25FBa.TTF" AddFontResource(cFontBC) define font cFontBC name "LBPremium25FBa" size 65, -50 of ip_caixa e imprimo normal. ip_caixa:Say(lin_lis,sal_col*3,"*"+strzero(te_numero,10)+"*",cFontBC,0,CLR_BLALCK) pra esta fonte que mandei funciona, para as fontes nativas do windows code128.TTF e code39r.TTF nao funciona Quote Link to comment Share on other sites More sharing options...
kapiaba Posted April 3, 2023 Report Share Posted April 3, 2023 Elas aparecem na BANDEJA de FONTES do WINDOWS? Se não, você precisa instalar manualmente, dando dois clicks nela. Abs. Quote Link to comment Share on other sites More sharing options...
MAMP2 Posted April 3, 2023 Author Report Share Posted April 3, 2023 elas aparecem, porem nao funcionam Quote Link to comment Share on other sites More sharing options...
kapiaba Posted April 3, 2023 Report Share Posted April 3, 2023 Tente setar a FONT com SET FONT... e veja os exemplos do \samples TESTPRN?.PRG kapiche? Abs Regards, saludos. Quote Link to comment Share on other sites More sharing options...
MAMP2 Posted April 3, 2023 Author Report Share Posted April 3, 2023 procurei em testprn.prg e nao achei nenhum "set font" la? onde estou errando? Quote Link to comment Share on other sites More sharing options...
kapiaba Posted April 3, 2023 Report Share Posted April 3, 2023 Post o código da Function até o activate do relatório para eu ver se Define Font está dentro do LOOP. abs. Quote Link to comment Share on other sites More sharing options...
MAMP2 Posted April 3, 2023 Author Report Share Posted April 3, 2023 ************************* function testa_etiqueta() ************************* sal_lin = 11 sal_col = 4.5 linha = sal_lin coluna = sal_col te_numero = 0 te_nome = space(10) define font memvar->rec_sen ; name "Courier" ; size 10,15 ; bold DEFINE DIALOG oDlg3 FROM 10,15 TO 17,70 ; TITLE "Controle de acesso : "+memvar->te_drive+" Terminal : "+memvar->te_term ; font memvar->rec_sen @ linha,coluna say "NUMERO : " of oDlg3 pixel coluna += sal_col*09 @ linha,coluna get oget var memvar->te_numero pict "9999999999" size sal_col*12,10 of oDlg3 pixel coluna += sal_col*12 @ linha,coluna say "NOME : " of oDlg3 pixel coluna += sal_col*08 @ linha,coluna get oget1 var memvar->te_nome pict "@!" size sal_col*12,10 of oDlg3 pixel valid cont_etique() activate dialog oDlg3 centered Return (.t.) ********************** function cont_etique() ********************** memvar ip_caixa LOCAL cFont39r:=alltrim(memvar->te_drive)+"\libreBarcode39-Regular.ttf" AddFontResource(cFont39r) memvar->oDlg3:End() if memvar->te_esc_imp = "S" printerSetUp() endif print ip_caixa name " Teste etiqueta codigo de barras" preview **\ print ip_caixa name " Teste etiqueta codigo de barras" if Empty( ip_caixa:hDC ) MsgStop( "Impressora com problemas" ) close return nil endif te_prn_esc = upper(PrnGetName()) define font dl_cx_fo1 name "Calibri" size 12, -12 bold of ip_caixa define font dl_cx_fo2 name "Arial" size 12, -14 bold of ip_caixa define font dl_cx_fo3 name "Arial" size 14, -14 bold of ip_caixa define font dl_cx_fo4 name "Arial Black" size 40, 25 bold of ip_caixa define font dl_cx_fo5 name "Courier New" size 27, -12 bold of ip_caixa define font dl_cx_fo6 name "Arial" size 10, -10 bold of ip_caixa define font cFont39r name "LibreBarcode39-Regular" size 60, -70 of ip_caixa define pen dl_caneta1 width 05 color CLR_BLACK sal_lin := ip_caixa:nVertRes() / 66 sal_col := ip_caixa:nHorzRes() / 60 page lin_lis := sal_lin*2 ip_caixa:Say(lin_lis,sal_col*3,"*"+strzero(te_numero,10)+"*",cFont39r,0,CLR_BLACK) lin_lis += sal_lin*20 ip_caixa:Say(lin_lis,sal_col*3,te_nome,dl_cx_fo4,0,CLR_BLACK) endpage endprint Return (.t.) segue tambem a TTF que nao funciona pra voce ver LibreBarcode39-Regular.ttf Quote Link to comment Share on other sites More sharing options...
kapiaba Posted April 3, 2023 Report Share Posted April 3, 2023 Tire a palavra Regular da chamada, chame só o nome da FONTE. Quote Link to comment Share on other sites More sharing options...
MAMP2 Posted April 3, 2023 Author Report Share Posted April 3, 2023 mas o nome da fonte tem -Regular no nome, se nao colocar nao vai se referenciar a fonte certa Quote Link to comment Share on other sites More sharing options...
kapiaba Posted April 3, 2023 Report Share Posted April 3, 2023 Aqui eu não chamo cim -regular e funciona de boas nas minhas fontes instaladas com dous clicks nela. Quote Link to comment Share on other sites More sharing options...
MAMP2 Posted April 3, 2023 Author Report Share Posted April 3, 2023 ************************* function testa_etiqueta() ************************* sal_lin = 11 sal_col = 4.5 linha = sal_lin coluna = sal_col te_numero = 0 te_nome = space(10) define font memvar->rec_sen ; name "Courier" ; size 10,15 ; bold DEFINE DIALOG oDlg3 FROM 10,15 TO 17,70 ; TITLE "Controle de acesso : "+memvar->te_drive+" Terminal : "+memvar->te_term ; font memvar->rec_sen @ linha,coluna say "NUMERO : " of oDlg3 pixel coluna += sal_col*09 @ linha,coluna get oget var memvar->te_numero pict "9999999999" size sal_col*12,10 of oDlg3 pixel coluna += sal_col*12 @ linha,coluna say "NOME : " of oDlg3 pixel coluna += sal_col*08 @ linha,coluna get oget1 var memvar->te_nome pict "@!" size sal_col*12,10 of oDlg3 pixel valid cont_etique() activate dialog oDlg3 centered Return (.t.) ********************** function cont_etique() ********************** memvar ip_caixa LOCAL cFont39r:=alltrim(memvar->te_drive)+"\Code39r.ttf" AddFontResource(cFont39r) memvar->oDlg3:End() if memvar->te_esc_imp = "S" printerSetUp() endif print ip_caixa name " Teste etiqueta codigo de barras" preview **\ print ip_caixa name " Teste etiqueta codigo de barras" if Empty( ip_caixa:hDC ) MsgStop( "Impressora com problemas" ) close return nil endif te_prn_esc = upper(PrnGetName()) define font dl_cx_fo1 name "Calibri" size 12, -12 bold of ip_caixa define font dl_cx_fo2 name "Arial" size 12, -14 bold of ip_caixa define font dl_cx_fo3 name "Arial" size 14, -14 bold of ip_caixa define font dl_cx_fo4 name "Arial Black" size 40, 25 bold of ip_caixa define font dl_cx_fo5 name "Courier New" size 27, -12 bold of ip_caixa define font dl_cx_fo6 name "Arial" size 10, -10 bold of ip_caixa define font cFont39r name "Code39r" size 60, -70 of ip_caixa define pen dl_caneta1 width 05 color CLR_BLACK sal_lin := ip_caixa:nVertRes() / 66 sal_col := ip_caixa:nHorzRes() / 60 page lin_lis := sal_lin*2 ip_caixa:Say(lin_lis,sal_col*3,"*"+strzero(te_numero,10)+"*",cFont39r,0,CLR_BLACK) lin_lis += sal_lin*20 ip_caixa:Say(lin_lis,sal_col*3,te_nome,dl_cx_fo4,0,CLR_BLACK) endpage endprint Return (.t.) troquei para outra cod39r.ttf, tambem nao funciona, segue ela pra voce ver Code39r.ttf Quote Link to comment Share on other sites More sharing options...
Theotokos Posted April 4, 2023 Report Share Posted April 4, 2023 TENTE ASSIM: define font cFont39r name "Libre Barcode 39" size 60, -70 of ip_caixa Quote Link to comment Share on other sites More sharing options...
kapiaba Posted April 4, 2023 Report Share Posted April 4, 2023 O mesmo código visto por outro PRISMA: define font cFont39r name "Libre Barcode 39" size 60, -70 of ip_caixa //-> Theotokos(Rone) #include "FiveWin.ch" #Define PAD_LEFT 0 #Define PAD_RIGHT 1 #Define PAD_CENTER 2 FUNCTION testa_etiqueta() sal_lin = 11 sal_col = 4.5 linha = sal_lin coluna = sal_col te_numero = 0 te_nome = SPACE( 10 ) DEFINE FONT MEMVAR->rec_sen NAME "Courier New" SIZE 10, 15 BOLD DEFINE DIALOG oDlg3 FROM 10, 15 TO 17, 70 ; TITLE "Controle de acesso : " + MEMVAR->te_drive + " Terminal : " + ; MEMVAR->te_term FONT MEMVAR->rec_sen oDlg3:lHelpIcon := .F. @ linha, coluna SAY "NUMERO : " OF oDlg3 PIXEL UPDATE coluna += sal_col * 09 @ linha, coluna GET oget VAR MEMVAR->te_numero PICT "9999999999" ; UPDATE SIZE sal_col * 12, 10 OF oDlg3 PIXEL coluna += sal_col * 12 @ linha, coluna SAY "NOME : " OF oDlg3 PIXEL UPDATE coluna += sal_col * 08 @ linha, coluna GET oget1 VAR MEMVAR->te_nome PICT "@!" ; SIZE sal_col * 12, 10 OF oDlg3 PIXEL VALID cont_etique() UPDATE ACTIVATE DIALOG oDlg3 CENTERED // FECHE AS FONTES AQUI RETURN ( .T. ) FUNCTION cont_etique() LOCAL ip_caixa //=> oPrn // Desnecessario se ja estiver instalada na bandeja de FONTES. LOCAL cFONT39r := AllTrim( MEMVAR->te_drive ) + "\Code39r.ttf" // se e MEMVAR, e depois da LOCAL // MEMVAR ip_caixa // AddFONTResource( cFONT39r ) // desncessario se ja esta instalada. MEMVAR->oDlg3:End() IF MEMVAR->te_esc_imp = "S" PRINTERSETUP() ENDIF // MUDEI EM: 04/04/2023 - Joao PRINT ip_caixa NAME "Teste etiqueta codigo de barras" PREVIEW MODAL IF Empty( ip_caixa:hDC ) MsgStop( "Impressora com problemas" ) ip_caixa:End() CLOSE RETURN NIL ENDIF // ponha antes da impressao // te_prn_esc = Upper( PrnGetNAME() ) //???? reveja isso, sei la... kkkk // Organizacao e Metodo. // MUDEI EM: 04/04/2023 - Joao DEFINE FONT dl_cx_fo1 NAME "Calibri" SIZE 12, -12 BOLD OF ip_caixa DEFINE FONT dl_cx_fo2 NAME "Arial" SIZE 12, -14 BOLD OF ip_caixa DEFINE FONT dl_cx_fo3 NAME "Arial" SIZE 14, -14 BOLD OF ip_caixa DEFINE FONT dl_cx_fo4 NAME "Arial Black" SIZE 40, 25 BOLD OF ip_caixa DEFINE FONT dl_cx_fo5 NAME "Courier New" SIZE 27, -12 BOLD OF ip_caixa DEFINE FONT dl_cx_fo6 NAME "Arial" SIZE 10, -10 BOLD OF ip_caixa DEFINE FONT cFONT39r NAME "Code39r" SIZE 60, -70 OF ip_caixa // Caneta do Preview // MUDEI EM: 04/04/2023 - Joao DEFINE PEN dl_caneta1 WIDTH 05 COLOR CLR_BLACK OF ip_caixa // MUDEI EM: 04/04/2023 - Joao oPrn:SetPage( 9 ) //-> A4 //9 oPrn:SetPortrait() //-> Vertical(Retrato) sal_lin := ip_caixa:nVertRes() / 66 sal_col := ip_caixa:nHorzRes() / 60 PAGE lin_lis := sal_lin * 2 /* // Modelo: oPrn:Say( nLinha * ResLinha, nColuna * ResColuna, ; "Orçamento Nº.: " + ALLTRIM( nProposta ), oFont, , ; CLR_BLACK, , PAD_CENTER ) */ // MUDEI EM: 04/04/2023 - Joao o que e esse "*" ip_caixa:Say( lin_lis, sal_col * 3, "*" + StrZero( te_numero, 10 ) ; + "*", cFONT39r, , CLR_BLACK, , PAD_CENTER ) lin_lis += sal_lin * 20 ip_caixa:Say( lin_lis, sal_col * 3, te_nome, dl_cx_fo4, , CLR_BLACK, , PAD_CENTER ) ENDPAGE ENDPRINT // MUDEI EM: 04/04/2023 - Joao RETURN NIL // ( .T. ) // VERDADEIRO PORQUE? TEM VALID()? OXXYYYYYY kkkkk // fin / end Regards, saludos. Quote Link to comment Share on other sites More sharing options...
MAMP2 Posted April 4, 2023 Author Report Share Posted April 4, 2023 bom dia theotokos, nao deu certo. ************************* function testa_etiqueta() ************************* sal_lin = 11 sal_col = 4.5 linha = sal_lin coluna = sal_col te_numero = 0 te_nome = space(10) define font memvar->rec_sen ; name "Courier" ; size 10,15 ; bold DEFINE DIALOG oDlg3 FROM 10,15 TO 17,70 ; TITLE "Controle de acesso : "+memvar->te_drive+" Terminal : "+memvar->te_term ; font memvar->rec_sen @ linha,coluna say "NUMERO : " of oDlg3 pixel coluna += sal_col*09 @ linha,coluna get oget var memvar->te_numero pict "9999999999" size sal_col*12,10 of oDlg3 pixel coluna += sal_col*12 @ linha,coluna say "NOME : " of oDlg3 pixel coluna += sal_col*08 @ linha,coluna get oget1 var memvar->te_nome pict "@!" size sal_col*12,10 of oDlg3 pixel valid cont_etique() activate dialog oDlg3 centered Return (.t.) ********************** function cont_etique() ********************** memvar ip_caixa LOCAL cFont39r:=alltrim(memvar->te_drive)+"\LibreBarcode39-Regular.ttf" AddFontResource(cFont39r) memvar->oDlg3:End() if memvar->te_esc_imp = "S" printerSetUp() endif print ip_caixa name " Teste etiqueta codigo de barras" preview **\ print ip_caixa name " Teste etiqueta codigo de barras" if Empty( ip_caixa:hDC ) MsgStop( "Impressora com problemas" ) close return nil endif te_prn_esc = upper(PrnGetName()) define font dl_cx_fo1 name "Calibri" size 12, -12 bold of ip_caixa define font dl_cx_fo2 name "Arial" size 12, -14 bold of ip_caixa define font dl_cx_fo3 name "Arial" size 14, -14 bold of ip_caixa define font dl_cx_fo4 name "Arial Black" size 40, 25 bold of ip_caixa define font dl_cx_fo5 name "Courier New" size 27, -12 bold of ip_caixa define font dl_cx_fo6 name "Arial" size 10, -10 bold of ip_caixa define font cFont39r name "LibreBarcode39" size 60, -70 of ip_caixa define pen dl_caneta1 width 05 color CLR_BLACK sal_lin := ip_caixa:nVertRes() / 66 sal_col := ip_caixa:nHorzRes() / 60 page lin_lis := sal_lin*2 ip_caixa:Say(lin_lis,sal_col*3,"*"+strzero(te_numero,10)+"*",cFont39r,0,CLR_BLACK) lin_lis += sal_lin*20 ip_caixa:Say(lin_lis,sal_col*3,te_nome,dl_cx_fo4,0,CLR_BLACK) endpage endprint Return (.t.) segue como ficou pra sabe se fiz certo, mas nao funcionou Quote Link to comment Share on other sites More sharing options...
Theotokos Posted April 4, 2023 Report Share Posted April 4, 2023 ************************* function testa_etiqueta() ************************* sal_lin = 11 sal_col = 4.5 linha = sal_lin coluna = sal_col te_numero = 0 te_nome = space(10) define font memvar->rec_sen ; name "Courier" ; size 10,15 ; bold DEFINE DIALOG oDlg3 FROM 10,15 TO 17,70 ; TITLE "Controle de acesso : "+memvar->te_drive+" Terminal : "+memvar->te_term ; font memvar->rec_sen @ linha,coluna say "NUMERO : " of oDlg3 pixel coluna += sal_col*09 @ linha,coluna get oget var memvar->te_numero pict "9999999999" size sal_col*12,10 of oDlg3 pixel coluna += sal_col*12 @ linha,coluna say "NOME : " of oDlg3 pixel coluna += sal_col*08 @ linha,coluna get oget1 var memvar->te_nome pict "@!" size sal_col*12,10 of oDlg3 pixel valid cont_etique() activate dialog oDlg3 centered Return (.t.) ********************** function cont_etique() ********************** memvar ip_caixa LOCAL cFont39r:=alltrim(memvar->te_drive)+"\LibreBarcode39-Regular.ttf" AddFontResource(cFont39r) memvar->oDlg3:End() if memvar->te_esc_imp = "S" printerSetUp() endif print ip_caixa name " Teste etiqueta codigo de barras" preview **\ print ip_caixa name " Teste etiqueta codigo de barras" if Empty( ip_caixa:hDC ) MsgStop( "Impressora com problemas" ) close return nil endif te_prn_esc = upper(PrnGetName()) define font dl_cx_fo1 name "Calibri" size 12, -12 bold of ip_caixa define font dl_cx_fo2 name "Arial" size 12, -14 bold of ip_caixa define font dl_cx_fo3 name "Arial" size 14, -14 bold of ip_caixa define font dl_cx_fo4 name "Arial Black" size 40, 25 bold of ip_caixa define font dl_cx_fo5 name "Courier New" size 27, -12 bold of ip_caixa define font dl_cx_fo6 name "Arial" size 10, -10 bold of ip_caixa //// define font cFont39r name "LibreBarcode39" size 60, -70 of ip_caixa define font cFont39r name "Libre Barcode 39" size 60, -70 of ip_caixa define pen dl_caneta1 width 05 color CLR_BLACK sal_lin := ip_caixa:nVertRes() / 66 sal_col := ip_caixa:nHorzRes() / 60 page lin_lis := sal_lin*2 ip_caixa:Say(lin_lis,sal_col*3,"*"+strzero(te_numero,10)+"*",cFont39r,0,CLR_BLACK) lin_lis += sal_lin*20 ip_caixa:Say(lin_lis,sal_col*3,te_nome,dl_cx_fo4,0,CLR_BLACK) endpage endprint Return (.t.) Quote Link to comment Share on other sites More sharing options...
MAMP2 Posted April 4, 2023 Author Report Share Posted April 4, 2023 com os espacos em branco? Quote Link to comment Share on other sites More sharing options...
Theotokos Posted April 4, 2023 Report Share Posted April 4, 2023 ISSO MESMO!!!! Quote Link to comment Share on other sites More sharing options...
MAMP2 Posted April 4, 2023 Author Report Share Posted April 4, 2023 esta dando este erro, segue o PRG fiz um pequenomarcos.prg pra facilitar marcos.prg Quote Link to comment Share on other sites More sharing options...
kapiaba Posted April 4, 2023 Report Share Posted April 4, 2023 5 minutos atrás, MAMP2 disse: com os espacos em branco? Abra a pasta(bandeija) das fontes e escreva do jeito que você lê. Veja imagem: https://imgur.com/2f969lu Quote Link to comment Share on other sites More sharing options...
Theotokos Posted April 4, 2023 Report Share Posted April 4, 2023 4 minutos atrás, MAMP2 disse: esta dando este erro, segue o PRG fiz um pequenomarcos.prg pra facilitar marcos.prg 3 kB · 1 download vc definiu ip_caixa como objeto de PRINT.... entao onde esta oPrn: troque por ip_caixa: Quote Link to comment Share on other sites More sharing options...
kapiaba Posted April 4, 2023 Report Share Posted April 4, 2023 5 minutos atrás, MAMP2 disse: esta dando este erro, segue o PRG fiz um pequenomarcos.prg pra facilitar marcos.prg 3 kB · 0 downloads Ooops, desculpe é que eu uso oPrn e você ip_caixa. ip_caixa:SetPage( 9 ) //-> A4 //9 = a oPrn, ok? ip_caixa:SetPortrait() //-> Vertical(Retrato) Regards, saludos. Quote Link to comment Share on other sites More sharing options...
Theotokos Posted April 4, 2023 Report Share Posted April 4, 2023 da forma que lhe falei para fazer :define font cFont39r name "Libre Barcode 39" size 60, -70 of ip_caixa 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.