From 0a5ffe1407b90018167c9e5129ce0f187cd2ef69 Mon Sep 17 00:00:00 2001 From: MEHMETKECECI Date: Mon, 16 Feb 2026 15:07:21 +0300 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- svc/routes/order_pdf.go | 29 +++++++++++++++-------------- svc/routes/pdf_assets.go | 2 +- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/svc/routes/order_pdf.go b/svc/routes/order_pdf.go index 1d74e60..c8cb103 100644 --- a/svc/routes/order_pdf.go +++ b/svc/routes/order_pdf.go @@ -5,8 +5,6 @@ import ( "database/sql" "errors" "fmt" - "github.com/gorilla/mux" - "github.com/jung-kurt/gofpdf" "log" "math" "net/http" @@ -15,6 +13,9 @@ import ( "strconv" "strings" "time" + + "github.com/gorilla/mux" + "github.com/jung-kurt/gofpdf" ) /* =========================================================== @@ -416,7 +417,7 @@ func newOrderPdf() (*gofpdf.Fpdf, error) { pdf.AliasNbPages("") pdf.SetFooterFunc(func() { pdf.SetY(-10) - pdf.SetFont("dejavu", "", 8) + pdf.SetFont("dejavu", "B", 8) txt := fmt.Sprintf("Sayfa %d/{nb}", pdf.PageNo()) pdf.CellFormat(0, 10, txt, "", 0, "R", false, 0, "") }) @@ -724,7 +725,7 @@ func drawOrderHeader(pdf *gofpdf.Fpdf, h *OrderHeader, showDesc bool) float64 { pdf.SetFillColor(149, 113, 22) // Baggi altın pdf.Rect(titleX, titleY, titleW, 10, "F") - pdf.SetFont("dejavu-b", "", 13) + pdf.SetFont("dejavu", "B", 13) pdf.SetTextColor(255, 255, 255) pdf.SetXY(titleX+4, titleY+2) pdf.CellFormat(titleW-8, 6, "BAGGI TEKSTİL - SİPARİŞ FORMU", "", 0, "L", false, 0, "") @@ -740,7 +741,7 @@ func drawOrderHeader(pdf *gofpdf.Fpdf, h *OrderHeader, showDesc bool) float64 { pdf.SetDrawColor(180, 180, 180) pdf.Rect(boxX, boxY, boxW, boxH, "") - pdf.SetFont("dejavu-b", "", 9) + pdf.SetFont("dejavu", "B", 9) pdf.SetTextColor(149, 113, 22) rep := strings.TrimSpace(h.CustomerRep) if rep == "" { @@ -795,7 +796,7 @@ func drawOrderHeader(pdf *gofpdf.Fpdf, h *OrderHeader, showDesc bool) float64 { pdf.Rect(marginL, y, pageW-marginL*2, descBoxH, "") // Başlık - pdf.SetFont("dejavu-b", "", 8) + pdf.SetFont("dejavu", "B", 8) pdf.SetTextColor(149, 113, 22) pdf.SetXY(marginL+3, y+2) pdf.CellFormat(40, 4, "Sipariş Genel Açıklaması:", "", 0, "L", false, 0, "") @@ -823,7 +824,7 @@ func drawOrderHeader(pdf *gofpdf.Fpdf, h *OrderHeader, showDesc bool) float64 { =========================================================== */ func drawGridHeader(pdf *gofpdf.Fpdf, layout pdfLayout, startY float64, catSizes CategorySizeMap) float64 { - pdf.SetFont("dejavu-b", "", 6) + pdf.SetFont("dejavu", "B", 6) pdf.SetDrawColor(baggiGrayBorderR, baggiGrayBorderG, baggiGrayBorderB) pdf.SetFillColor(baggiCreamR, baggiCreamG, baggiCreamB) pdf.SetTextColor(20, 20, 20) // 🟣 TÜM HEADER YAZILARI SİYAH @@ -1191,7 +1192,7 @@ func drawTotalsBox( valueX := x + w - 70 // değerlerin sağda hizalanacağı kolon pdf.SetTextColor(149, 113, 22) // Sol başlık gold - pdf.SetFont("dejavu-b", "", 8.5) + pdf.SetFont("dejavu", "B", 8.5) y := startY + 2 @@ -1202,7 +1203,7 @@ func drawTotalsBox( pdf.CellFormat(80, lineH, "TOPLAM TUTAR", "", 0, "L", false, 0, "") pdf.SetTextColor(201, 162, 39) - pdf.SetFont("dejavu-b", "", 9) + pdf.SetFont("dejavu", "B", 9) pdf.SetXY(valueX, y) pdf.CellFormat(65, lineH, @@ -1217,7 +1218,7 @@ func drawTotalsBox( if hasVat { pdf.SetTextColor(149, 113, 22) // gold başlık - pdf.SetFont("dejavu-b", "", 8.5) + pdf.SetFont("dejavu", "B", 8.5) pdf.SetXY(labelX, y) pdf.CellFormat(80, lineH, @@ -1225,7 +1226,7 @@ func drawTotalsBox( "", 0, "L", false, 0, "") pdf.SetTextColor(20, 20, 20) - pdf.SetFont("dejavu-b", "", 9) + pdf.SetFont("dejavu", "B", 9) pdf.SetXY(valueX, y) pdf.CellFormat(65, lineH, @@ -1238,13 +1239,13 @@ func drawTotalsBox( 3️⃣ KDV DAHİL TOPLAM ---------------------------------------------------- */ pdf.SetTextColor(201, 162, 39) - pdf.SetFont("dejavu-b", "", 8.5) + pdf.SetFont("dejavu", "B", 8.5) pdf.SetXY(labelX, y) pdf.CellFormat(80, lineH, "KDV DAHİL TOPLAM TUTAR", "", 0, "L", false, 0, "") pdf.SetTextColor(20, 20, 20) - pdf.SetFont("dejavu-b", "", 9) + pdf.SetFont("dejavu", "B", 9) pdf.SetXY(valueX, y) pdf.CellFormat(65, lineH, @@ -1273,7 +1274,7 @@ func drawGroupSummaryBar(pdf *gofpdf.Fpdf, layout pdfLayout, groupName string, t pdf.SetDrawColor(214, 192, 106) pdf.Rect(x, y, w, h, "DF") - pdf.SetFont("dejavu-b", "", 8.5) + pdf.SetFont("dejavu", "B", 8.5) pdf.SetTextColor(20, 20, 20) leftTxt := strings.ToUpper(strings.TrimSpace(groupName)) diff --git a/svc/routes/pdf_assets.go b/svc/routes/pdf_assets.go index 033d8aa..97ef515 100644 --- a/svc/routes/pdf_assets.go +++ b/svc/routes/pdf_assets.go @@ -87,7 +87,7 @@ func resolveAssetPath(fileName string, relativeDirs []string) (string, error) { return "", fmt.Errorf("asset not found: %s (tried: %s)", fileName, strings.Join(tried, ", ")) } -func registerDejavuFonts(pdf *gofpdf.Fpdf) error { +func registerDejavuFonts(pdf *gofpdf.Fpdf, s string, s2 string) error { regPath, err := resolvePdfAssetPath("DejaVuSans.ttf") if err != nil {