Horizon
Loading...
Searching...
No Matches
canvas_pdf.hpp
1#pragma once
2#include "canvas/canvas.hpp"
3#include <podofo/podofo.h>
4
5namespace horizon {
6
7double to_pt(double x_nm);
8
9class CanvasPDF : public Canvas {
10public:
11 CanvasPDF(PoDoFo::PdfPainter &painter, PoDoFo::PdfFont &font, const class PDFExportSettings &settings);
12 void push() override
13 {
14 }
15
16 void request_push() override;
17 bool layer_filter = false;
18 int current_layer = 0;
19 bool fill = true;
20 bool use_layer_colors = false;
21 const auto &get_selectables() const
22 {
23 return selectables;
24 }
25
26private:
27 PoDoFo::PdfPainter &painter;
28 PoDoFo::PdfFont &font;
29 const PDFExportSettings &settings;
30 const PoDoFo::PdfFontMetrics *metrics;
31 void img_line(const Coordi &p0, const Coordi &p1, const uint64_t width, int layer, bool tr) override;
32 void img_polygon(const class Polygon &poly, bool tr) override;
33 void img_draw_text(const Coordf &p, float size, const std::string &rtext, int angle, bool flip, TextOrigin origin,
34 int layer = 10000, uint64_t width = 0, TextData::Font font = TextData::Font::SIMPLEX,
35 bool center = false, bool mirror = false) override;
36 void img_hole(const Hole &hole) override;
37 bool pdf_layer_visible(int l) const;
38 void draw_polygon(const Polygon &ipoly, bool tr);
39 Color get_pdf_layer_color(int layer) const;
40};
41} // namespace horizon
Definition canvas_pdf.hpp:9
Definition canvas.hpp:25
Definition common.hpp:278
A hole with diameter and position, that's it.
Definition hole.hpp:15
Definition pdf_export_settings.hpp:9
Polygon used in Padstack, Package and Board for specifying filled Regions.
Definition polygon.hpp:25