Beispiel #1
0
    def GET(self,id):
        
        gml = list(model.get_globalparams())
        formg = GlobalParam.formg()
        glo = list(model.get_localparams())
        formlA = localParamA.formlocA()
        formlB = self.formlocB()
        gm = list(model.get_globalparam(cFont.idglobal))
        formg.fill({'metapolation':gm[0].metapolation,'fontsize':gm[0].fontsize,'mean':gm[0].mean,'cap':gm[0].cap,'ascl':gm[0].ascl,'des':gm[0].des,'box':gm[0].box})
        idlA = cFont.idlocalA  
        idlB =id 
        if idlA > '0' :
          gloA = list(model.get_localparam(idlA))
        else:
          gloA = None
        if idlB > '0' :
          gloB = list(model.get_localparam(id))
        else:
          gloB = None

        if gloA != None:
           formlA.fill({'px':gloA[0].px,'width':gloA[0].width,'space':gloA[0].space,'xheight':gloA[0].xheight,'capital':gloA[0].capital,'boxheight':gloA[0].boxheight,'ascender':gloA[0].ascender,'descender':gloA[0].descender,'inktrap':gloA[0].inktrap,'stemcut':gloA[0].stemcut,'skeleton':gloA[0].skeleton,'superness':gloA[0].superness,'over':gloA[0].over})
        if gloB != None:
           formlB.fill({'px':gloB[0].px,'width':gloB[0].width,'space':gloB[0].space,'xheight':gloB[0].xheight,'capital':gloB[0].capital,'boxheight':gloB[0].boxheight,'ascender':gloB[0].ascender,'descender':gloB[0].descender,'inktrap':gloB[0].inktrap,'stemcut':gloB[0].stemcut,'skeleton':gloB[0].skeleton,'superness':gloB[0].superness,'over':gloB[0].over})

        return render.font4(formg,gml,cFont,glo,formlA,formlB)
Beispiel #2
0
    def GET(self,id):
        
        print "getparam",id
        gml = list(model.get_globalparams())
        formg = self.formg()
        if id > '0' :
          gm = list(model.get_globalparam(id))
        else:
          gm = None

        if gm != None:
             formg.fill({'metapolation':gm[0].metapolation,'fontsize':gm[0].fontsize,'mean':gm[0].mean,'cap':gm[0].cap,'ascl':gm[0].ascl,'des':gm[0].des,'box':gm[0].box})
        return render.font2(formg,gml,cFont)
Beispiel #3
0
    def POST (self,id):
        print "postparam",id
        gml = list(model.get_globalparams())
        gm = list(model.get_globalparam(id))
        formg = self.formg()
        formg.fill()
        if formg.validates  :
               model.update_globalparam(id, formg.d.metapolation, formg.d.fontsize, formg.d.mean, formg.d.cap, formg.d.ascl, formg.d.des, formg.d.box)
        if not formg.validates() :
               return render.font2(formg,gml,cFont)

        model.writeGlobalParam()

        return render.font2(formg,gml,cFont)
Beispiel #4
0
    def GET(self, id):
        if not is_loggedin():
            raise seeother('/login')

        gm = list(model.get_globalparam(id))
        if not gm:
            return web.notfound()

        formg = GlobalParamForm()
        formg.fill({'metapolation': gm[0].metapolation, 'fontsize': gm[0].fontsize,
                    'mean': gm[0].mean, 'cap': gm[0].cap, 'ascl': gm[0].ascl,
                    'des': gm[0].des, 'box': gm[0].box})

        gml = list(model.get_globalparams())
        return render.globals(gml, formg)
Beispiel #5
0
    def POST(self, id):
        if not is_loggedin():
            raise seeother('/login')

        gm = list(model.get_globalparam(id))
        if not gm:
            return web.notfound()

        formg = GlobalParamForm()
        if formg.validates():
            model.update_globalparam(id, formg.d.metapolation, formg.d.fontsize,
                                     formg.d.mean, formg.d.cap, formg.d.ascl,
                                     formg.d.des, formg.d.box)
            return seeother('/settings/globals/')

        gml = list(model.get_globalparams())
        return render.globals(gml, formg)
Beispiel #6
0
    def POST(self, id):
        print "postparam", id
        gml = list(model.get_globalparams())
        gm = list(model.get_globalparam(id))
        formg = self.formg()
        formg.fill()
        if formg.validates:
            model.update_globalparam(id, formg.d.metapolation,
                                     formg.d.fontsize, formg.d.mean,
                                     formg.d.cap, formg.d.ascl, formg.d.des,
                                     formg.d.box)
        if not formg.validates():
            return render.font2(formg, gml, cFont)

        model.writeGlobalParam()

        return render.font2(formg, gml, cFont)
Beispiel #7
0
    def GET(self,id):
        """ View single post """
        form=self.form()
        
        if id > '0' : 
           post = model.get_post(int(id))
           glyphparam = model.get_glyphparam(int(id))
           groupparam = model.get_groupparam(int(id))         
           form.fill(post)
        posts = model.get_posts()
        postspa = model.get_postspa()
        formParam = self.formParam()
        formParamG = self.formParamG()
        if glyphparam != None :
           formParam.fill(glyphparam)
        if groupparam != None :
           formParamG.fill(groupparam)
        mastglobal = model.get_globalparam(cFont.idglobal)
        master = model.get_master(cFont.idmaster)
	webglyph = cFont.glyphName
        return render.view(posts,post,form,formParam,formParamG,master,mastglobal,webglyph,glyphparam,groupparam,cFont,postspa)
Beispiel #8
0
    def GET(self, id):

        print "getparam", id
        gml = list(model.get_globalparams())
        formg = self.formg()
        if id > '0':
            gm = list(model.get_globalparam(id))
        else:
            gm = None

        if gm != None:
            formg.fill({
                'metapolation': gm[0].metapolation,
                'fontsize': gm[0].fontsize,
                'mean': gm[0].mean,
                'cap': gm[0].cap,
                'ascl': gm[0].ascl,
                'des': gm[0].des,
                'box': gm[0].box
            })
        return render.font2(formg, gml, cFont)
Beispiel #9
0
    def GET(self, id):
        """ View single post """
        form = self.form()

        if id > '0':
            post = model.get_post(int(id))
            glyphparam = model.get_glyphparam(int(id))
            groupparam = model.get_groupparam(int(id))
            form.fill(post)
        posts = model.get_posts()
        postspa = model.get_postspa()
        formParam = self.formParam()
        formParamG = self.formParamG()
        if glyphparam != None:
            formParam.fill(glyphparam)
        if groupparam != None:
            formParamG.fill(groupparam)
        mastglobal = model.get_globalparam(cFont.idglobal)
        master = model.get_master(cFont.idmaster)
        webglyph = cFont.glyphName
        return render.view(posts, post, form, formParam, formParamG, master,
                           mastglobal, webglyph, glyphparam, groupparam, cFont,
                           postspa)
Beispiel #10
0
    def POST(self, id):
        form = View.form()
        formParam = View.formParam()
        formParamG = View.formParamG()
        post = model.get_post(int(id))
        postspa = model.get_postspa()
        formParam = self.formParam()
        if not form.validates() :
            posts = model.get_posts()
            master = model.get_master(cFont.idmaster)
            mastglobal = model.get_globalparam(cFont.idglobal)
	    webglyph = cFont.glyphName
            return render.view(posts, post, form, formParam, master,mastglobal, webglyph,glyphparam,groupparam,cFont,postspa)
        if form.d.PointName != None :
            if not formParam.validates() :
                return render.view(posts, post, form, formParam, master,mastglobal)
            if model.get_glyphparam(int(id)) != None :
                model.update_glyphparam(int(id),form.d.PointName,form.d.groupn)
                model.update_glyphparamD(int(id),formParam.d.Param, formParam.d.parmval)
                if model.get_groupparam0(form.d.groupn) != None: 
                    model.update_groupparamD(form.d.groupn, formParamG.d.Group, formParamG.d.groupval)
                else:
                    model.insert_groupparam( form.d.groupn )
             
            else :
                model.insert_glyphparam(int(id),form.d.PointName )
                model.update_glyphparam(int(id),form.d.PointName,form.d.groupn)
                if model.get_groupparam0(form.d.groupn) != None: 
                    model.update_groupparamD(form.d.groupn, formParamG.d.Group, formParamG.d.groupval)
                else:
                    model.insert_groupparam( form.d.groupn )
           
            if not formParamG.validates() :
                return render.view(posts, post, form, formParam, formParamG, master,mastglobal)
            if model.get_groupparam(int(id)) != None :
                if form.d.groupn != None :
                   if model.get_groupparam0(form.d.groupn) != None: 
                      model.update_groupparamD(form.d.groupn, formParamG.d.Group, formParamG.d.groupval)
                   else:
                     model.insert_groupparam( form.d.groupn )
                
        model.update_post(int(id), form.d.x, form.d.y)
        posts = model.get_posts()
        master = model.get_master(cFont.idmaster)
        mastglobal = model.get_globalparam(cFont.idglobal)
	webglyph = cFont.glyphName
        glyphparam = model.get_glyphparam(int(id))
        groupparam = model.get_groupparam(int(id))

        if cFont.mfoption =='1' :
           model.writeallxmlfromdb()
        else:
           model.writexml()        
        
        model.ufo2mf() 
        os.environ['MFINPUTS'] = cFont.fontpath
#        os.environ['MPINPUTS'] = cFont.fontpath
        model.writeGlyphlist()
        strms = "sh makefont.sh font.mf"
        os.system(strms)
        return render.view(posts, post, form, formParam, formParamG, master, mastglobal,webglyph,glyphparam,groupparam,cFont,postspa)
Beispiel #11
0
    def GET(self, id):

        gml = list(model.get_globalparams())
        formg = GlobalParam.formg()
        glo = list(model.get_localparams())
        formlA = localParamA.formlocA()
        formlB = self.formlocB()
        gm = list(model.get_globalparam(cFont.idglobal))
        formg.fill({
            'metapolation': gm[0].metapolation,
            'fontsize': gm[0].fontsize,
            'mean': gm[0].mean,
            'cap': gm[0].cap,
            'ascl': gm[0].ascl,
            'des': gm[0].des,
            'box': gm[0].box
        })
        idlA = cFont.idlocalA
        idlB = id
        if idlA > '0':
            gloA = list(model.get_localparam(idlA))
        else:
            gloA = None
        if idlB > '0':
            gloB = list(model.get_localparam(id))
        else:
            gloB = None

        if gloA != None:
            formlA.fill({
                'px': gloA[0].px,
                'width': gloA[0].width,
                'space': gloA[0].space,
                'xheight': gloA[0].xheight,
                'capital': gloA[0].capital,
                'boxheight': gloA[0].boxheight,
                'ascender': gloA[0].ascender,
                'descender': gloA[0].descender,
                'inktrap': gloA[0].inktrap,
                'stemcut': gloA[0].stemcut,
                'skeleton': gloA[0].skeleton,
                'superness': gloA[0].superness,
                'over': gloA[0].over
            })
        if gloB != None:
            formlB.fill({
                'px': gloB[0].px,
                'width': gloB[0].width,
                'space': gloB[0].space,
                'xheight': gloB[0].xheight,
                'capital': gloB[0].capital,
                'boxheight': gloB[0].boxheight,
                'ascender': gloB[0].ascender,
                'descender': gloB[0].descender,
                'inktrap': gloB[0].inktrap,
                'stemcut': gloB[0].stemcut,
                'skeleton': gloB[0].skeleton,
                'superness': gloB[0].superness,
                'over': gloB[0].over
            })

        return render.font4(formg, gml, cFont, glo, formlA, formlB)
Beispiel #12
0
    def POST(self, id):
        form = View.form()
        formParam = View.formParam()
        formParamG = View.formParamG()
        post = model.get_post(int(id))
        postspa = model.get_postspa()
        formParam = self.formParam()
        if not form.validates():
            posts = model.get_posts()
            master = model.get_master(cFont.idmaster)
            mastglobal = model.get_globalparam(cFont.idglobal)
            webglyph = cFont.glyphName
            return render.view(posts, post, form, formParam, master,
                               mastglobal, webglyph, glyphparam, groupparam,
                               cFont, postspa)
        if form.d.PointName != None:
            if not formParam.validates():
                return render.view(posts, post, form, formParam, master,
                                   mastglobal)
            if model.get_glyphparam(int(id)) != None:
                model.update_glyphparam(int(id), form.d.PointName,
                                        form.d.groupn)
                model.update_glyphparamD(int(id), formParam.d.Param,
                                         formParam.d.parmval)
                if model.get_groupparam0(form.d.groupn) != None:
                    model.update_groupparamD(form.d.groupn, formParamG.d.Group,
                                             formParamG.d.groupval)
                else:
                    model.insert_groupparam(form.d.groupn)

            else:
                model.insert_glyphparam(int(id), form.d.PointName)
                model.update_glyphparam(int(id), form.d.PointName,
                                        form.d.groupn)
                if model.get_groupparam0(form.d.groupn) != None:
                    model.update_groupparamD(form.d.groupn, formParamG.d.Group,
                                             formParamG.d.groupval)
                else:
                    model.insert_groupparam(form.d.groupn)

            if not formParamG.validates():
                return render.view(posts, post, form, formParam, formParamG,
                                   master, mastglobal)
            if model.get_groupparam(int(id)) != None:
                if form.d.groupn != None:
                    if model.get_groupparam0(form.d.groupn) != None:
                        model.update_groupparamD(form.d.groupn,
                                                 formParamG.d.Group,
                                                 formParamG.d.groupval)
                    else:
                        model.insert_groupparam(form.d.groupn)

        model.update_post(int(id), form.d.x, form.d.y)
        posts = model.get_posts()
        master = model.get_master(cFont.idmaster)
        mastglobal = model.get_globalparam(cFont.idglobal)
        webglyph = cFont.glyphName
        glyphparam = model.get_glyphparam(int(id))
        groupparam = model.get_groupparam(int(id))

        if cFont.mfoption == '1':
            model.writeallxmlfromdb()
        else:
            model.writexml()

        model.ufo2mf()
        os.environ['MFINPUTS'] = cFont.fontpath
        #        os.environ['MPINPUTS'] = cFont.fontpath
        model.writeGlyphlist()
        strms = "sh makefont.sh font.mf"
        os.system(strms)
        return render.view(posts, post, form, formParam, formParamG, master,
                           mastglobal, webglyph, glyphparam, groupparam, cFont,
                           postspa)