Esempio n. 1
0
def DibCreatePatternBrush(ctx, page, i):
    h, biWidth, biHeight, biSize, bshift, data = page.cmds[i].args
    eo = mfpage.mfobj()
    eo.type = 2
    eo.style = 3  ## pattern brush
    eo.data = biWidth, biHeight, biSize, bshift, data  ## temporary assume 1 bpp image
    page.mfobjs[h] = eo
Esempio n. 2
0
def DibCreatePatternBrush(ctx,page,i):
    h,biWidth,biHeight,biSize,bshift,data = page.cmds[i].args
    eo = mfpage.mfobj()
    eo.type = 2
    eo.style = 3 ## pattern brush
    eo.data = biWidth,biHeight,biSize,bshift,data ## temporary assume 1 bpp image
    page.mfobjs[h]=eo
Esempio n. 3
0
def CreateBrushIndirect(ctx,page,i):
    bgclr = mfpage.color()
    h,bgclr.r,bgclr.g,bgclr.b = page.cmds[i].args
    eo = mfpage.mfobj()
    eo.type = 2
    eo.clr = bgclr
    page.mfobjs[h]=eo
    print i,'Brush: ',bgclr.r,bgclr.g,bgclr.b,' Handle: ',h
Esempio n. 4
0
def CreatePalette(ctx, page, i):
    h, numofclr, data = page.cmds[i].args
    eo = mfpage.mfobj()
    eo.type = 4
    for j in range(numofclr):
        clr = mfpage.color()
        clr.r, clr.g, clr.b = data[j * 4], data[j * 4 + 1], data[j * 4 + 2]
        page.palette[j] = clr
    page.mfobjs[h] = eo
Esempio n. 5
0
def CreatePalette(ctx,page,i):
    h,numofclr,data = page.cmds[i].args
    eo = mfpage.mfobj()
    eo.type = 4
    for j in range(numofclr):
        clr = mfpage.color()
        clr.r,clr.g,clr.b = data[j*4],data[j*4+1],data[j*4+2]
        page.palette[j]=clr
    page.mfobjs[h]=eo
Esempio n. 6
0
def ExtCreatePen(ctx,page,i):
    fgclr = mfpage.color()
    h,fgclr.r,fgclr.g,fgclr.b = page.cmds[i].args
    eo = mfpage.mfobj()
    eo.type = 1
    eo.clr = fgclr
    eo.width = 5. ## what is default?
    page.mfobjs[h]=eo
    print i,'ExtPen: ',fgclr.r,fgclr.g,fgclr.b,' Handle: ',h
Esempio n. 7
0
def CreatePen(ctx,page,i):
    fgclr = mfpage.color()
    h,fgclr.r,fgclr.g,fgclr.b,width = page.cmds[i].args
    eo = mfpage.mfobj()
    eo.type = 1
    eo.clr = fgclr
    eo.width = width
    page.mfobjs[h]=eo
    print i,'Pen: ',fgclr.r,fgclr.g,fgclr.b,' Handle: ',h
Esempio n. 8
0
def CreateBrushIndirect(ctx, page, i):
    bgclr = mfpage.color()
    h, bgclr.r, bgclr.g, bgclr.b, flag, lbStyle, lbHatch = page.cmds[i].args
    eo = mfpage.mfobj()
    eo.type = 2
    eo.clr = bgclr
    eo.style = lbStyle
    eo.hatch = lbHatch
    eo.flag = flag
    page.mfobjs[h] = eo
Esempio n. 9
0
def CreatePen(ctx, page, i):
    fgclr = mfpage.color()
    h, fgclr.r, fgclr.g, fgclr.b, flag, width, style = page.cmds[i].args
    eo = mfpage.mfobj()
    eo.type = 1
    eo.clr = fgclr
    eo.width = width
    eo.style = style
    eo.flag = flag
    page.mfobjs[h] = eo
Esempio n. 10
0
def CreateBrushIndirect(ctx,page,i):
    bgclr = mfpage.color()
    h,bgclr.r,bgclr.g,bgclr.b,flag,lbStyle,lbHatch = page.cmds[i].args
    eo = mfpage.mfobj()
    eo.type = 2
    eo.clr = bgclr
    eo.style = lbStyle
    eo.hatch = lbHatch
    eo.flag = flag    
    page.mfobjs[h]=eo
Esempio n. 11
0
def CreatePen(ctx,page,i):
    fgclr = mfpage.color()
    h,fgclr.r,fgclr.g,fgclr.b,flag,width,style = page.cmds[i].args
    eo = mfpage.mfobj()
    eo.type = 1
    eo.clr = fgclr
    eo.width = width
    eo.style = style
    eo.flag = flag
    page.mfobjs[h]=eo
Esempio n. 12
0
def ExtCreateFontIndirectW(ctx,page,i):
    h = page.cmds[i].args[0]
    size = page.cmds[i].args[1]
    if size <0:
        size = -size
    weight = page.cmds[i].args[5]
    italic = page.cmds[i].args[6]
    font = page.cmds[i].args[14]
    font = unicode(font,'utf-16').encode('utf-8')
    pos = font.find('\x00')
    font = font[0:pos]
    eo = mfpage.mfobj()
    eo.type = 3
    eo.font = font
    eo.italic = italic
    eo.size = size
    eo.weight = weight
    page.mfobjs[h]=eo
    print i,'Font: ',font,italic,weight,page.cmds[i].args[1],' Handle: ',h
Esempio n. 13
0
def CreateFontIndirect(ctx, page, i):
    h = page.cmds[i].args[0]
    eo = mfpage.mfobj()
    eo.type = 3
    size = page.cmds[i].args[1][0]
    if size < 0:
        size = -size
    if size == 0:
        size = 12
    eo.size = size
    eo.weight = page.cmds[i].args[1][4]
    eo.escape = page.cmds[i].args[1][2]
    eo.orient = page.cmds[i].args[1][3]
    eo.italic = page.cmds[i].args[1][5]
    eo.under = page.cmds[i].args[1][6]
    eo.strike = page.cmds[i].args[1][7]
    eo.charset = page.cmds[i].args[1][8]
    font = page.cmds[i].args[2]
    pos = font.find('\x00')
    font = font[0:pos]
    eo.font = font
    page.mfobjs[h] = eo
Esempio n. 14
0
def CreateFontIndirect(ctx,page,i):
    h = page.cmds[i].args[0]
    eo = mfpage.mfobj()
    eo.type = 3
    size = page.cmds[i].args[1][0]
    if size < 0:
        size = -size
    if size == 0:
        size = 12
    eo.size = size
    eo.weight = page.cmds[i].args[1][4]
    eo.escape = page.cmds[i].args[1][2]
    eo.orient = page.cmds[i].args[1][3]
    eo.italic = page.cmds[i].args[1][5]
    eo.under = page.cmds[i].args[1][6]
    eo.strike = page.cmds[i].args[1][7]
    eo.charset = page.cmds[i].args[1][8]
    font = page.cmds[i].args[2]
    pos = font.find('\x00')
    font = font[0:pos]
    eo.font = font
    page.mfobjs[h]=eo
Esempio n. 15
0
def CreateFontIndirect(ctx,page,i):
    h = page.cmds[i].args[0]
    eo = mfpage.mfobj()
    eo.type = 3
    size = page.cmds[i].args[1]
    if size < 0:
        size = -size
    if size == 0:
        size = 12
    eo.size = size
    eo.weight = page.cmds[i].args[5]
    eo.escape = page.cmds[i].args[3] ##!!!!!
    eo.orient = page.cmds[i].args[4]   ##!!!!!
    eo.italic = page.cmds[i].args[6]
    eo.under = page.cmds[i].args[7]
    eo.strike = page.cmds[i].args[8]
    font = page.cmds[i].args[14]
    font = unicode(font,'utf-16').encode('utf-8')
    pos = font.find('\x00')
    font = font[0:pos]
    eo.font = font
    page.mfobjs[h]=eo
    print 'CreateFontIndirect'