コード例 #1
0
	def get_line_style(self, **kw):
		if kw['8'] in self.layer_dict:
			self.default_layer = layer_name = kw['8']
		else:
			layer_name = self.default_layer

		linetype_name = upper(kw['6'])
		scale = kw['48']
		color_index = kw['62']
		
		
		style = Style()
		style.line_width = self.get_line_width()
		style.line_join = const.JoinRound
		style.line_cap = const.CapRound
		style.line_dashes = self.get_line_type(linetype_name = linetype_name, scale = scale, width = style.line_width)
		style.line_pattern = self.get_pattern(color_index)

		return style
コード例 #2
0
from app import SolidPattern, HatchingPattern,EmptyPattern, \
  LinearGradient, ConicalGradient, RadialGradient, ImageTilePattern, \
  Style, MultiGradient, Trafo, Translation, Point, \
  GridLayer, GuideLayer, GuideLine, Arrow, CreatePath, StandardColors, \
  GetFont

from app.io.load import GenericLoader

from app.Graphics import pagelayout, plugobj, blendgroup, text, image, eps,\
  properties

base_style = Style()
base_style.fill_pattern = EmptyPattern
base_style.fill_transform = 1
base_style.line_pattern = SolidPattern(StandardColors.black)
base_style.line_width = 0.0
base_style.line_join = const.JoinMiter
base_style.line_cap = const.CapButt
base_style.line_dashes = ()
base_style.line_arrow1 = None
base_style.line_arrow2 = None
base_style.font = None
base_style.font_size = 12.0

# sanity check: does base_style have all properties?
for key in dir(properties.factory_defaults):
    if not hasattr(base_style, key):
        #warn(INTERNAL, 'added default for property %s', key)
        setattr(base_style, key, getattr(properties.factory_defaults, key))

papersizes = [
コード例 #3
0
import os

from app.utils.os_utils import relpath, Empty
from app import IdentityMatrix, EmptyPattern, SolidPattern, Style, \
		StandardColors, SketchError, const
from app.Graphics import properties
from app.Graphics.image import CMYK_IMAGE
from app.Lib.units import m_to_pt, in_to_pt



base_style = Style()
base_style.fill_pattern = EmptyPattern
base_style.fill_transform = 1
base_style.line_pattern = SolidPattern(StandardColors.black)
base_style.line_width = 0.0
base_style.line_join = const.JoinMiter
base_style.line_cap = const.CapButt
base_style.line_dashes = ()
base_style.line_arrow1 = None
base_style.line_arrow2 = None
base_style.font = None
base_style.font_size = 12.0

papersizes = {
	'A0': (0.841 * m_to_pt, 1.189 * m_to_pt),
	'A1': (0.594 * m_to_pt, 0.841 * m_to_pt),
	'A2': (0.420 * m_to_pt, 0.594 * m_to_pt),
	'A3': (0.297 * m_to_pt, 0.420 * m_to_pt),
	'A4': (0.210 * m_to_pt, 0.297 * m_to_pt),
	'A5': (0.148 * m_to_pt, 0.210 * m_to_pt),
コード例 #4
0
from app import _, Trafo, Scale, Translation, Point, Polar, CreatePath, \
		CreateRGBColor, SolidPattern, EmptyPattern, LinearGradient, \
		MultiGradient, Style, const, StandardColors, GridLayer, GetFont, \
		HatchingPattern

from app.events.warn import INTERNAL, warn_tb
from app.io.load import GenericLoader, SketchLoadError
import uniconvertor
from app.Graphics import text

basestyle = Style()
basestyle.fill_pattern = EmptyPattern
basestyle.fill_transform = 1
basestyle.line_pattern = EmptyPattern
basestyle.line_width = 1.0
basestyle.line_join = const.JoinMiter
basestyle.line_cap = const.CapButt
basestyle.line_dashes = ()
basestyle.line_arrow1 = None
basestyle.line_arrow2 = None
basestyle.font = None
basestyle.font_size = 12.0


CGM_ID = {
	0x0020: 'BEGMF',
	0x0040: 'ENDMF',
	0x0060: 'BEGPIC',
	0x0080: 'BEGPICBODY',
	0x00A0: 'ENDPIC',