I am using pytrf for create a document.
I want to make the Heading font with a particular kind of colour, but i 
cannot manage to change the color of the font.
I manage to use only the standard colour in the StyleSheet.

Here is the code implemented:
def render_doc():
    import gluon.contrib.pyrtf as q
    doc.Sections.append(section)
    section=q.Section(break_type=q.Section.PAGE, first_page_number=1)
    ss=q.StyleSheet()
    ss.Colours.accepted_type = True
    ss.Colours.append(q.Colour('Equi',250,255,0))
    para_ps = q.ParagraphPropertySet()
    para_ps.SetAlignment(3)
    p = q.Paragraph(para_ps) 
    text_ps_heading = q.TextPropertySet(size=38,bold=True)
*    text_ps_heading.SetColour(ss.Colours.Equi)   *
    text_heading = q.Text('\par HEADING \par' ,text_ps_heading)
    p.append(text_heading)
    section.append(p)
    response.headers['Content-Type']='text/rtf'
    return q.dumps(doc)


The text_heading rendering appear BLACK

Instead if i change :
*text_ps_heading.SetColour(ss.Colours.Equi)   
*Into*
**text_ps_heading.SetColour(ss.Colours.Red) 
*
The text_heading rendering appear RED
Is like ss.Colours don't take the new colour CLASS.
Am i wrong?
How i could set a new colour in the ss.Colours?

-- 



Reply via email to