Merge branch 'master' of ssh://git.code.sf.net/p/free-cad/code
This commit is contained in:
commit
730866e384
|
@ -749,7 +749,9 @@ def makeText(stringslist,point=Vector(0,0,0),screen=False):
|
||||||
typecheck([(point,Vector)], "makeText")
|
typecheck([(point,Vector)], "makeText")
|
||||||
if not isinstance(stringslist,list): stringslist = [stringslist]
|
if not isinstance(stringslist,list): stringslist = [stringslist]
|
||||||
textbuffer = []
|
textbuffer = []
|
||||||
for l in stringslist: textbuffer.append(l.decode("utf8").encode('latin1'))
|
for l in stringslist:
|
||||||
|
#textbuffer.append(l.decode("utf8").encode('latin1'))
|
||||||
|
textbuffer.append(str(l))
|
||||||
obj=FreeCAD.ActiveDocument.addObject("App::Annotation","Text")
|
obj=FreeCAD.ActiveDocument.addObject("App::Annotation","Text")
|
||||||
obj.LabelText=textbuffer
|
obj.LabelText=textbuffer
|
||||||
obj.Position=point
|
obj.Position=point
|
||||||
|
@ -1528,7 +1530,6 @@ def getSVG(obj,scale=1,linewidth=0.35,fontsize=12,fillstyle="shape color",direct
|
||||||
svg += '</text>\n</g>\n'
|
svg += '</text>\n</g>\n'
|
||||||
|
|
||||||
elif getType(obj) == "Annotation":
|
elif getType(obj) == "Annotation":
|
||||||
LINESPACING = 1
|
|
||||||
"returns an svg representation of a document annotation"
|
"returns an svg representation of a document annotation"
|
||||||
p = getProj(obj.Position)
|
p = getProj(obj.Position)
|
||||||
svg = '<text id="' + obj.Name + '" fill="'
|
svg = '<text id="' + obj.Name + '" fill="'
|
||||||
|
@ -1555,7 +1556,7 @@ def getSVG(obj,scale=1,linewidth=0.35,fontsize=12,fillstyle="shape color",direct
|
||||||
if i == 0:
|
if i == 0:
|
||||||
svg += '<tspan>'
|
svg += '<tspan>'
|
||||||
else:
|
else:
|
||||||
svg += '<tspan x="0" dy="'+str(fontsize+LINESPACING)+'">'
|
svg += '<tspan x="0" dy="'+str(obj.ViewObject.LineSpacing/2)+'">'
|
||||||
svg += obj.LabelText[i]+'</tspan>\n'
|
svg += obj.LabelText[i]+'</tspan>\n'
|
||||||
svg += '</text>\n'
|
svg += '</text>\n'
|
||||||
print svg
|
print svg
|
||||||
|
|
|
@ -95,11 +95,12 @@ def deformat(text):
|
||||||
sts = re.split("\\\\(U\+....)",t)
|
sts = re.split("\\\\(U\+....)",t)
|
||||||
ns = u""
|
ns = u""
|
||||||
for ss in sts:
|
for ss in sts:
|
||||||
|
print ss, type(ss)
|
||||||
if ss.startswith("U+"):
|
if ss.startswith("U+"):
|
||||||
ucode = "0x"+ss[2:]
|
ucode = "0x"+ss[2:]
|
||||||
ns += unichr(eval(ucode))
|
ns += unichr(eval(ucode))
|
||||||
else:
|
else:
|
||||||
ns += ss
|
ns += ss.decode("utf8")
|
||||||
t = ns
|
t = ns
|
||||||
# replace degrees, diameters chars
|
# replace degrees, diameters chars
|
||||||
t = re.sub('%%d','°',t)
|
t = re.sub('%%d','°',t)
|
||||||
|
@ -1145,7 +1146,7 @@ def processdxf(document,filename):
|
||||||
newob.ViewObject.FontSize = FreeCADGui.draftToolBar.fontsize
|
newob.ViewObject.FontSize = FreeCADGui.draftToolBar.fontsize
|
||||||
else:
|
else:
|
||||||
st = rawValue(dim,3)
|
st = rawValue(dim,3)
|
||||||
newob.ViewObject.FontSize = float(getdimheight(st))
|
newob.ViewObject.FontSize = float(getdimheight(st))*TEXTSCALING
|
||||||
else:
|
else:
|
||||||
FreeCAD.Console.PrintMessage("skipping dimensions...\n")
|
FreeCAD.Console.PrintMessage("skipping dimensions...\n")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user