mcc2 1.5.3 → 1.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/mcc2/layout_file.rb +1 -1
- data/lib/mcc2/layout_object/barcode.rb +1 -1
- data/lib/mcc2/layout_object/chip.rb +1 -1
- data/lib/mcc2/layout_object/text.rb +2 -2
- data/lib/mcc2/layoutview.rb +9 -8
- data/lib/mcc2/printer/file_printer.rb +1 -1
- data/lib/mcc2/printer/gdi_printer.rb +2 -0
- data/lib/mcc2/printer/printer_cx320_direct.rb +5 -0
- data/lib/mcc2/printer/printer_epl.rb +0 -1
- data/lib/mcc2/printer/printer_ttp34x.rb +0 -1
- data/lib/mcc2/printer/svg_drawer.rb +14 -17
- data/lib/mcc2/version.rb +1 -1
- data/lib/mcc2.rb +0 -3
- data.tar.gz.sig +4 -1
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 88caa0afeffe21403f7eaf590a271323d79d81c8102ebf098162da86bb0f0b20
|
|
4
|
+
data.tar.gz: 729959b75dc73d36cd7590fafa3cea24f5d834a0fb9ad69bde710e9699bfcb0c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9bb41b5be91d9f48580d1d2e721845aa2f08177b4df99283899b8e999b81b774f2b3f017910c87ad90f5b85478e6b326b5defe149933caf9c57bac1dd95165a0
|
|
7
|
+
data.tar.gz: 53b16488b203c3fca0490418fde92477423814c412f18baef669845fc77bcfaf4b88903a8b6a7417102aed3e5aa81070637c5df4cda60831153415e55b28996e
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/lib/mcc2/layout_file.rb
CHANGED
|
@@ -16,7 +16,7 @@ module Mcc2
|
|
|
16
16
|
add_attr(@go_attributes, GOA_FONT_COLOR, String, "000000FF")
|
|
17
17
|
add_attr(@go_attributes, GOA_FONT_FILE, String, "")
|
|
18
18
|
add_attr(@go_attributes, GOA_BACK_COLOR, String, "FFFFFFFF")
|
|
19
|
-
add_attr(@go_attributes,
|
|
19
|
+
add_attr(@go_attributes, GOA_JUSTIFICATION, String, S_JUST_LEFT)
|
|
20
20
|
add_attr(@go_attributes, GOA_BARCODE_OPTION_1, Integer, -1)
|
|
21
21
|
add_attr(@go_attributes, GOA_BARCODE_OPTION_2, Integer, 0)
|
|
22
22
|
add_attr(@go_attributes, GOA_BARCODE_OPTION_3, Integer, 0)
|
|
@@ -4,8 +4,8 @@ module Mcc2
|
|
|
4
4
|
def initialize(xml_elem: nil, layout_file: nil)
|
|
5
5
|
super
|
|
6
6
|
@go_attributes[GOA_TYP].attr_value = TEXTOBJECT
|
|
7
|
-
add_attr(@go_attributes, GOA_WIDTH, Integer,
|
|
8
|
-
add_attr(@go_attributes, GOA_HEIGHT, Integer,
|
|
7
|
+
add_attr(@go_attributes, GOA_WIDTH, Integer, "")
|
|
8
|
+
add_attr(@go_attributes, GOA_HEIGHT, Integer, "")
|
|
9
9
|
add_attr(@go_attributes, GOA_DATA, String, "")
|
|
10
10
|
add_attr(@go_attributes, GOA_SAMPLE_DATA, String, "Sample-Text")
|
|
11
11
|
add_attr(@go_attributes, GOA_FONT_HEIGHT, Integer, 10)
|
data/lib/mcc2/layoutview.rb
CHANGED
|
@@ -543,13 +543,6 @@ module Mcc2
|
|
|
543
543
|
@lf.tabitem_font.shown = true
|
|
544
544
|
@lf.textfield_text_color.text = obj[GOA_FONT_COLOR]
|
|
545
545
|
|
|
546
|
-
fill_font_list
|
|
547
|
-
fill_font_fields(obj)
|
|
548
|
-
end
|
|
549
|
-
|
|
550
|
-
# Attribute, die nur Texte haben
|
|
551
|
-
if obj[GOA_TYP] == TEXTOBJECT
|
|
552
|
-
@lf.horizontalframe_justify.shown = true
|
|
553
546
|
# den Radiobutton der Ausrichtung setzen
|
|
554
547
|
@lf.radiobutton_just_l.state = false
|
|
555
548
|
@lf.radiobutton_just_m.state = false
|
|
@@ -562,6 +555,14 @@ module Mcc2
|
|
|
562
555
|
when S_JUST_RIGHT
|
|
563
556
|
@lf.radiobutton_just_r.state = true
|
|
564
557
|
end
|
|
558
|
+
|
|
559
|
+
fill_font_list
|
|
560
|
+
fill_font_fields(obj)
|
|
561
|
+
end
|
|
562
|
+
|
|
563
|
+
# Attribute, die nur Texte haben
|
|
564
|
+
if obj[GOA_TYP] == TEXTOBJECT
|
|
565
|
+
@lf.checkbutton_justify.shown = true
|
|
565
566
|
@lf.checkbutton_justify.setCheck(obj[GOA_JUSTIFICATION_BLOCK] == "true")
|
|
566
567
|
|
|
567
568
|
data_block_shown
|
|
@@ -569,8 +570,8 @@ module Mcc2
|
|
|
569
570
|
|
|
570
571
|
# Attribute, die nur Barcodes haben
|
|
571
572
|
if obj[GOA_TYP] == BARCODEOBJECT
|
|
573
|
+
@lf.checkbutton_justify.shown = false
|
|
572
574
|
@lf.tabitem_barcode.shown = true
|
|
573
|
-
@lf.horizontalframe_justify.shown = false
|
|
574
575
|
[1, 2, 3].each do |optx|
|
|
575
576
|
@lf.send("spinner_barcode_option_#{optx}").value = obj[Mcc2.const_get("GOA_BARCODE_OPTION_#{optx}")].to_i
|
|
576
577
|
end
|
|
@@ -117,7 +117,7 @@ module Mcc2
|
|
|
117
117
|
# TODO where comes the factor 0.8 from?
|
|
118
118
|
svg_attrs = {width: "#{page_width*0.8}mm", height: "#{page_height*0.8}mm"}
|
|
119
119
|
end
|
|
120
|
-
svg_data = svg_builder(viewBox: "0 0 #{image_width} #{image_height}", **svg_attrs) do |svg|
|
|
120
|
+
svg_data = svg_builder(viewBox: "0 0 #{image_width} #{image_height}", **(svg_attrs || {})) do |svg|
|
|
121
121
|
tra = Transformation.new
|
|
122
122
|
draw(svg, tra.translate(mm(draw_pos_x).round, mm(draw_pos_y).round), layout_file, false, nil, row, page_nr)
|
|
123
123
|
end
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
require "json"
|
|
2
2
|
require "libcx320"
|
|
3
3
|
require "rmagick"
|
|
4
|
+
require 'rsvg2'
|
|
5
|
+
require 'cairo'
|
|
4
6
|
|
|
5
7
|
module Mcc2
|
|
6
8
|
module Printer
|
|
@@ -186,16 +188,19 @@ module Mcc2
|
|
|
186
188
|
|
|
187
189
|
if layers.include?(1)
|
|
188
190
|
pic = draw_rvg_image(layout_file, row, page, [1], x_offset, y_offset).negate
|
|
191
|
+
pic = pic.level2(Magick::QuantumRange / 2, Magick::QuantumRange / 2)
|
|
189
192
|
data_k = pic.export_pixels_to_str(0, 0, pic.columns, pic.rows, "R", Magick::CharPixel)
|
|
190
193
|
end
|
|
191
194
|
|
|
192
195
|
if layers.include?(2)
|
|
193
196
|
pic = draw_rvg_image(layout_file, row, page, [2], x_offset, y_offset).negate
|
|
197
|
+
pic = pic.level2(Magick::QuantumRange / 2, Magick::QuantumRange / 2)
|
|
194
198
|
data_uv = pic.export_pixels_to_str(0, 0, pic.columns, pic.rows, "R", Magick::CharPixel)
|
|
195
199
|
end
|
|
196
200
|
|
|
197
201
|
if layers.include?(3)
|
|
198
202
|
pic = draw_rvg_image(layout_file, row, page, [3], x_offset, y_offset).negate
|
|
203
|
+
pic = pic.level2(Magick::QuantumRange / 2, Magick::QuantumRange / 2)
|
|
199
204
|
data_peeloff = pic.export_pixels_to_str(0, 0, pic.columns, pic.rows, "R", Magick::CharPixel)
|
|
200
205
|
end
|
|
201
206
|
|
|
@@ -485,6 +485,7 @@ module Mcc2
|
|
|
485
485
|
option1 = go[GOA_BARCODE_OPTION_1].to_i
|
|
486
486
|
option2 = go[GOA_BARCODE_OPTION_2].to_i
|
|
487
487
|
option3 = go[GOA_BARCODE_OPTION_3].to_i
|
|
488
|
+
just = go[GOA_JUSTIFICATION]
|
|
488
489
|
font = go[GOA_FONT_TYP]
|
|
489
490
|
if font == "from_file"
|
|
490
491
|
font = go.layout_file.expand_path(go[GOA_FONT_FILE])
|
|
@@ -536,37 +537,33 @@ module Mcc2
|
|
|
536
537
|
xdim = xdim.to_i
|
|
537
538
|
ydim = ydim.to_i if barcode.rows > 1 # optimize y dimension only on 2D codes
|
|
538
539
|
end
|
|
539
|
-
|
|
540
|
-
px_width, px_height = mm(
|
|
540
|
+
go_width2, go_height2 = barcode_px_to_mm(xdim * xbars, barcode_dpi), barcode_px_to_mm(ydim * ybars, barcode_dpi)
|
|
541
|
+
px_width, px_height = mm(go_width2), mm(go_height2)
|
|
541
542
|
xdim = px_width / xbars / xgran
|
|
542
543
|
ydim = px_height / ybars / ygran
|
|
543
544
|
|
|
545
|
+
if just == S_JUST_RIGHT
|
|
546
|
+
apos = tra.translate(mm(go_width - go_width2), 0.0)
|
|
547
|
+
elsif just == S_JUST_MID
|
|
548
|
+
apos = tra.translate(mm(go_width - go_width2) / 2.0, 0.0)
|
|
549
|
+
else
|
|
550
|
+
apos = tra
|
|
551
|
+
end
|
|
552
|
+
|
|
544
553
|
pathd = +""
|
|
545
554
|
bcvector.each_rectangle do |bar|
|
|
546
555
|
# p [bar.x, bar.y, bar.width, bar.height]
|
|
547
556
|
# p [xdim*bar.width, ydim*bar.height, xdim*bar.x, ydim*bar.y]
|
|
548
|
-
x =
|
|
549
|
-
y =
|
|
550
|
-
# drawing.rectangle(
|
|
551
|
-
# x,
|
|
552
|
-
# y,
|
|
553
|
-
# x + [xdim * bar.width - 1, 0].max,
|
|
554
|
-
# y + [ydim * bar.height - 1, 0].max
|
|
555
|
-
# )
|
|
557
|
+
x = apos.x + xdim * bar.x
|
|
558
|
+
y = apos.y + ydim * bar.y
|
|
556
559
|
# drawing.rect(x: x, y: y, width: xdim * bar.width, height: ydim * bar.height, fill: font_color, stroke: "none")
|
|
557
|
-
# body.rect([xdim * bar.width / 2 - 1, 0].max, [ydim * bar.height / 2 - 1, 0].max, xdim * bar.x / 2, ydim * bar.y / 2)
|
|
558
560
|
w = xdim * bar.width
|
|
559
561
|
h = ydim * bar.height
|
|
560
562
|
pathd << "M#{x} #{y}h#{w}v#{h}h-#{w}Z"
|
|
561
563
|
end
|
|
562
564
|
drawing.path(d: pathd, stroke: "none", fill: font_color)
|
|
563
565
|
bcvector.each_string do |str|
|
|
564
|
-
|
|
565
|
-
# drawing.text_anchor(HALIGNMENT[str.halign])
|
|
566
|
-
# apos = tra.translate(xdim * str.x / xgran, )
|
|
567
|
-
# drawing.text(tra.x + xdim * str.x, tra.y + ydim * str.y, str.text)
|
|
568
|
-
# body.text(xdim * str.x / 2, ydim * str.y / 2, str.text).styles(text_anchor: HALIGNMENT[str.halign])
|
|
569
|
-
drawing.text_(str.text, x: tra.x + xdim * str.x, y: tra.y + ydim * str.y,
|
|
566
|
+
drawing.text_(str.text, x: apos.x + xdim * str.x, y: apos.y + ydim * str.y,
|
|
570
567
|
'text-anchor': HALIGNMENT[str.halign],
|
|
571
568
|
fill: font_color,
|
|
572
569
|
'font-size': pt(fontsize),
|
data/lib/mcc2/version.rb
CHANGED
data/lib/mcc2.rb
CHANGED
|
@@ -105,9 +105,6 @@ module Mcc2
|
|
|
105
105
|
GOA_LAYER = "layer"
|
|
106
106
|
GOA_FONT_HEIGHT = "font_height"
|
|
107
107
|
GOA_FONT_TYP = "font_typ"
|
|
108
|
-
GOA_FONT_WEIGHT = "font_weight"
|
|
109
|
-
GOA_FONT_STYLE = "font_style"
|
|
110
|
-
GOA_FONT_STRETCH = "font_stretch"
|
|
111
108
|
GOA_FONT_COLOR = "font_color"
|
|
112
109
|
GOA_FONT_FILE = "font_file"
|
|
113
110
|
GOA_BACK_COLOR = "back_color"
|
data.tar.gz.sig
CHANGED
|
@@ -1 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
�
|
|
2
|
+
�~�<����胍���l��-Vz�^��a)����,���&xc_���R�hհ2F�70�cpg�&����-�6n��z��p\4/G�MҮ��OѼ_6֥��HQ�z@!�<�2�� 5�;�FOl��L���[������u���E�f��
|
|
3
|
+
{�yF����`u���(J�-S�����m�jH��
|
|
4
|
+
�/��B�OO��3������O��l%F�q�s|����E������ o$����FM.+4�"O,�1��;��6�xv#:�1�m��S�n^a�G�fe����.��fV�d�A���iEo�
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mcc2
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.5.
|
|
4
|
+
version: 1.5.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Lars Kanis
|
|
@@ -428,7 +428,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
428
428
|
- !ruby/object:Gem::Version
|
|
429
429
|
version: '0'
|
|
430
430
|
requirements: []
|
|
431
|
-
rubygems_version: 4.0.
|
|
431
|
+
rubygems_version: 4.0.20
|
|
432
432
|
specification_version: 4
|
|
433
433
|
summary: Layout editor and card printer GUI
|
|
434
434
|
test_files: []
|
metadata.gz.sig
CHANGED
|
Binary file
|