Commits

Martin Vejnár committed 1100366

Some changes in text sizes and spacing.

Comments (0)

Files changed (1)

 
             self.print_wire(wire)
 
-        factor = 0.7
         if pin.visible & pin.PIN_VISIBLE_FLAG_PIN:
             o = Text()
             o.value = pin.name.split('@')[0]
             o.layer = 95
-            o.size = int(7620*2.5/2)
+            o.size = 14224/2
             o.angle = pin.angle * 0x400
             o.mirror = 0
 
-            text_distance = 2540*15
-            o.x, o.y = _get_target_xy(pin.x, pin.y, len + text_distance, -int(7620*2.5/2), pin.angle)
-            self.print_text(o, mirror=mirror, rotate=rot)
+            text_distance = 2540*10
+            o.x, o.y = _get_target_xy(pin.x, pin.y, len + text_distance, 0, pin.angle)
+            self.print_text(o, mirror=mirror, rotate=rot, middle=True)
 
         if device and (pin.visible & pin.PIN_VISIBLE_FLAG_PAD):
             contact = device.get_contact_for_pin(gate_id, pin.id)
                 o.x, o.y = _get_target_xy(pin.x, pin.y, max(0, min(len - max(shorten_wire, 2540*2), 2540 * 12)), 2540 if pin.angle < 2 else -2540, pin.angle)
                 self.print_text(o, mirror=mirror, rotate=rot)
 
-    def print_text(self, text, mirror=False, rotate=0):
+    def print_text(self, text, mirror=False, rotate=0, middle=False):
         self.update_bb(text.x - text.size, text.y - text.size)
         self.update_bb(text.x + text.size, text.y + text.size)
 
 
         trans = ' transform="%s"' % ' '.join(trans)
 
-        if top_adjust:
+        if middle:
+            trans += ' dominant-baseline="central"'
+        elif top_adjust:
             trans += ' dominant-baseline="text-before-edge"'
         if right_adjust:
             trans += ' text-anchor="end"'
 
         layer = self.root.layer_map[text.layer]
         self.out.append("""<text fill="%s" %s font-size="%d">%s</text>""" % (
-            self.color_map[layer.color], trans, int(text.size*2.5), text.value))
+            self.color_map[layer.color], trans, int(text.size*2.7), text.value))
 
     def print_symdef(self, sym):
         sym.group_id = self.group_count