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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 855e1465f8f907edc03e98b67391af70e68b7e4d5cf6122764f682d053521572
4
- data.tar.gz: 8f854eb535f83da27810589c712bf7afbc4eab6ecb76ae0460cb741f3c14237b
3
+ metadata.gz: 88caa0afeffe21403f7eaf590a271323d79d81c8102ebf098162da86bb0f0b20
4
+ data.tar.gz: 729959b75dc73d36cd7590fafa3cea24f5d834a0fb9ad69bde710e9699bfcb0c
5
5
  SHA512:
6
- metadata.gz: a95216bb7541a2fcb29e0aa3691141eaa9022be81622870116cb70cb2607506968dfa8451b5f52bd50d5d16de88a1f169eda735c5e1738de4153bd80c47f450c
7
- data.tar.gz: 273257ddab06a30f87fd50a4889dd30bfcfab4f8130e6feb9071269903d7de266ca4c124b5c5dcb2748e3a19769b4d6830746a44bc3ac45e0ee0aef7db625153
6
+ metadata.gz: 9bb41b5be91d9f48580d1d2e721845aa2f08177b4df99283899b8e999b81b774f2b3f017910c87ad90f5b85478e6b326b5defe149933caf9c57bac1dd95165a0
7
+ data.tar.gz: 53b16488b203c3fca0490418fde92477423814c412f18baef669845fc77bcfaf4b88903a8b6a7417102aed3e5aa81070637c5df4cda60831153415e55b28996e
checksums.yaml.gz.sig CHANGED
Binary file
@@ -243,7 +243,7 @@ PRINT 1
243
243
  set_attr_value(attr_name, param, S_CHIP)
244
244
  end
245
245
  elsif !param.to_s.empty?
246
- param = "#{i}=#{param}"
246
+ param = "#{i-1}=#{param}"
247
247
  set_attr_value(attr_name, param, S_CHIP)
248
248
  end
249
249
  end
@@ -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, GOA_FONT_WEIGHT, Integer, 0)
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)
@@ -19,7 +19,7 @@ module Mcc2
19
19
  end
20
20
 
21
21
  def params_hash(row = nil)
22
- params.map do |param|
22
+ params(row).map do |param|
23
23
  key, value = param.split("=", 2)
24
24
  if key && value
25
25
  [key, value]
@@ -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, 30)
8
- add_attr(@go_attributes, GOA_HEIGHT, Integer, 6)
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)
@@ -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,5 +1,7 @@
1
1
  require "win32api4ruby"
2
2
  require "mcc2_c_helper"
3
+ require 'rsvg2'
4
+ require 'cairo'
3
5
 
4
6
  Win32api4ruby::Base.unicode = true
5
7
 
@@ -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
 
@@ -1,4 +1,3 @@
1
- require "socket"
2
1
  require "rmagick"
3
2
  require 'rsvg2'
4
3
  require 'cairo'
@@ -1,4 +1,3 @@
1
- require "socket"
2
1
  require "rmagick"
3
2
  require 'rsvg2'
4
3
  require 'cairo'
@@ -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
- go_width, go_height = barcode_px_to_mm(xdim * xbars, barcode_dpi), barcode_px_to_mm(ydim * ybars, barcode_dpi)
540
- px_width, px_height = mm(go_width), mm(go_height)
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 = tra.x + xdim * bar.x
549
- y = tra.y + ydim * bar.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
- # p [str.x, str.y, str.text, str.halign, str.fsize]
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
@@ -1,3 +1,3 @@
1
1
  module Mcc2
2
- VERSION = "1.5.3"
2
+ VERSION = "1.5.5"
3
3
  end
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
- ��'�ы;Uϵ����F7�񋽞܅�q�Ԛ+��}�f�6��B������s i�0^]h����}�<�~97*.]^����3Rux���%����7H����b�sljS����!y��c��|�VgtA�hfn�H�8Csa��d��+�v�il�kɵ��+�����ƱV�v��f��P�*�����e�����Y�<'������kϳ�MFc���hV�N ����e����Do"3���ՙw\Q>\ ���gJ� ">�{�r��� ;?� ��!Ve�B��U�v�M���}��������ʺcr�d4�ov�K�j� �����{M7n���|��Wh���C�އe�(�RZKoKf� ��U8��T�̔�.�I� \
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.3
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.16
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