mcc2 1.5.4 → 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: bcf3cc173282198ab1be6840a1a144058ac88dba89e0c902fbc0c496b9f6822b
4
- data.tar.gz: b6d0905caada34aa1b01ca68342934e828006a6e41a7f31f17400fe010d3f248
3
+ metadata.gz: 88caa0afeffe21403f7eaf590a271323d79d81c8102ebf098162da86bb0f0b20
4
+ data.tar.gz: 729959b75dc73d36cd7590fafa3cea24f5d834a0fb9ad69bde710e9699bfcb0c
5
5
  SHA512:
6
- metadata.gz: b93df1be1e1f894299cd3f28e9c971444970ba87a9ea69d6c3c3baeeb604bcb54bc4f0bd7713974a28bc84b637f01e34a2de5067a6ff28a3e5a62d5f6577ad32
7
- data.tar.gz: 797a3ae2635ae015ec65dd5afe4b204a9af1eb24dadbb0bf94338a55a5d0b2e3158908fde0f1d964210dbc392810270e3c192a84128473393db0681aa68486ae
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
@@ -188,16 +188,19 @@ module Mcc2
188
188
 
189
189
  if layers.include?(1)
190
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)
191
192
  data_k = pic.export_pixels_to_str(0, 0, pic.columns, pic.rows, "R", Magick::CharPixel)
192
193
  end
193
194
 
194
195
  if layers.include?(2)
195
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)
196
198
  data_uv = pic.export_pixels_to_str(0, 0, pic.columns, pic.rows, "R", Magick::CharPixel)
197
199
  end
198
200
 
199
201
  if layers.include?(3)
200
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)
201
204
  data_peeloff = pic.export_pixels_to_str(0, 0, pic.columns, pic.rows, "R", Magick::CharPixel)
202
205
  end
203
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
- 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.4"
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
Binary file
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
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