mcc2 1.5.5 → 1.5.6

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: 88caa0afeffe21403f7eaf590a271323d79d81c8102ebf098162da86bb0f0b20
4
- data.tar.gz: 729959b75dc73d36cd7590fafa3cea24f5d834a0fb9ad69bde710e9699bfcb0c
3
+ metadata.gz: 04b179c2807041ccfec46f18af13d81c3d9d3e7bf98076efb2ee1848906cf0e2
4
+ data.tar.gz: 292e14fb85b636acc03b58ecbaf2c98500101ff8a2fc66e7e337f786ac94dece
5
5
  SHA512:
6
- metadata.gz: 9bb41b5be91d9f48580d1d2e721845aa2f08177b4df99283899b8e999b81b774f2b3f017910c87ad90f5b85478e6b326b5defe149933caf9c57bac1dd95165a0
7
- data.tar.gz: 53b16488b203c3fca0490418fde92477423814c412f18baef669845fc77bcfaf4b88903a8b6a7417102aed3e5aa81070637c5df4cda60831153415e55b28996e
6
+ metadata.gz: d74c2f2ad152f6fa47c37912f72ea2f17b265738b82b4e6323f4e7cea3bc8164086b1de24642db3ddb37a8af484140a8dea3f50bbb027bab8bf48c22e953c05a
7
+ data.tar.gz: 89a9179f3ab6611a8c2540d098b3a9a70f03f0a4db95b7fb470426f67a8b83825c106e883e85c56b366ba416ce2f9d12097cabaff9153d8c6b4691d55088827a
checksums.yaml.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- �!��vŮ�ن�1Қ��8B�u��Ɏy|Wz5*�qy: W14�ɩ:���f�naSۉ+X}Ů�ݔ�Пޤg�
2
- ��FX�d�m������gI�W��+���x~Tk^����^�}${ɵs�Dz��sbM��}D6����w���pR�4,UǏ��G��J��h��A�x�����B^�H B���L4�(�-Ro.�]gK��ԟ'�%r��B�]�g)���Zce���CIy��Ή�������1+�y�z�0�����%ב��$�D�^g�3��in f
1
+ /�i��?|���Y ��c�b�d�{m�{gL��L�K[=����}Bz�cP[p�0��"�: i�a�N��E;�����F恢��夝�$� ǂ-ˬ�5_���ة2��Q4�<=��"W
2
+ ?*�� �P�ϣ��h3�v�@���ߗyR7*Oј6��H�a�#"�W��g;��F�.k�آ�-D���ϣؗ`d`‚r���|�큁�� �U8�U�a�az�&׷jK��K同������8��0��[�^�c�l�=�Z�k��{�`}����>����_�Zњ[T��1�i|+���q��p�PB:FV9�T�sӧ����Ɍ/���!�� �K/���T�-�6�h'H����S(0�«/��&2#��^��d)t
@@ -192,6 +192,8 @@ module Mcc2
192
192
 
193
193
  attr_reader :font_map
194
194
 
195
+ # Attention: This method is called from the render thread.
196
+ # Be careful accessing instance variables!
195
197
  def draw_preview_now(row = nil)
196
198
  @font_map = {}
197
199
 
@@ -146,19 +146,18 @@ module Mcc2
146
146
  end.to_h.freeze
147
147
  end
148
148
  end
149
-
150
- @@font_map = SvgDrawer.builtin_font_names.dup
151
- @@pango_font_map = Pango::CairoFontMap.default
149
+ SvgDrawer.builtin_font_names
152
150
 
153
151
  def add_fonts_from_layout(layout_file)
152
+ @font_map = SvgDrawer.builtin_font_names.dup
154
153
  layout_file.sorted_id_list.each do |id|
155
154
  go = layout_file.find_graphic_object_by_id(id)
156
155
  font = go[GOA_FONT_TYP]
157
156
  if font == "from_file"
158
157
  font_path = go.layout_file.expand_path(go[GOA_FONT_FILE])
159
158
 
160
- @@font_map[font_path] ||= begin
161
- @@pango_font_map.add_font_file(font_path)
159
+ @font_map[font_path] ||= begin
160
+ PangoCairo::FontMap.default.add_font_file(font_path)
162
161
  fontinfo_from_file(font_path)
163
162
  end
164
163
  end
@@ -166,10 +165,10 @@ module Mcc2
166
165
  end
167
166
 
168
167
  def font_map
169
- @@font_map
168
+ @font_map
170
169
  end
171
170
  def pango_font_map
172
- @@pango_font_map
171
+ PangoCairo::FontMap.default
173
172
  end
174
173
 
175
174
  def flip_flop_mirrors(svg, tra, layout_file, preview, page)
@@ -642,7 +641,8 @@ module Mcc2
642
641
  end
643
642
 
644
643
  def get_font_info(font, obj)
645
- font_info = @@font_map[font]
644
+ raise "add_fonts_from_layout wasn't called" unless font_map
645
+ font_info = font_map[font]
646
646
  unless font_info
647
647
  raise Printer::Base::ResourceNotFoundError, I18n.t(:font_not_found, default: "Die Schriftart '%{font}' in Object %{obj} konnte nicht gefunden werden.", font:, obj: obj[GOA_NAME].inspect )
648
648
  end
data/lib/mcc2/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mcc2
2
- VERSION = "1.5.5"
2
+ VERSION = "1.5.6"
3
3
  end
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.5
4
+ version: 1.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lars Kanis
metadata.gz.sig CHANGED
Binary file