hello,
as @PluginStudent said ;), you have to be careful at what is static and not.
The SetFontSize function will only change the BaseContainer passed as an argument. It will have no effect to your instance.
An example using both method to set the height of the text.
import c4d
from c4d import gui
def DrawText():
# Creates GeClipMap to do some drawing operation
myGeClipMap = c4d.bitmaps.GeClipMap()
if myGeClipMap is None:
raise RuntimeError("Failed to create a GeClipMap")
# Initializes the GeClipMap with our Bitmap
w = h = 900
if not myGeClipMap.Init(w, h):
raise RuntimeError("Failed to initialize GeClipMap")
rgba = c4d.Vector4d(100,0,0,100)
# Start the drawing
myGeClipMap.BeginDraw()
# Defines the raw mode to blend (means we do not override existing pixel and use opacity)
myGeClipMap.SetDrawMode(c4d.GE_CM_DRAWMODE_BLEND, c4d.GE_CM_SRC_MAX_OPACITY)
# Defines the colors used to paint a rectangle
myGeClipMap.SetColor(rgba.x, rgba.y, rgba.z, rgba.w)
# Paints a rectangle into all the pictures
myGeClipMap.FillRect(0, 0, w, h)
# Change the colore for the text
myGeClipMap.SetColor(255, 255, 255, rgba.w)
# Retrieves the font description with the static function
bc = c4d.bitmaps.GeClipMap.GetFontDescription("CourierNewPS-ItalicMT", c4d.GE_FONT_NAME_POSTSCRIPT)
c4d.bitmaps.GeClipMap.SetFontSize(bc, c4d.GE_FONT_SIZE_INTERNAL, 50)
# Sets the font description of my GeCMaplip and use 0.0 to use the font size from BaseContainer
myGeClipMap.SetFont(bc, 0.0)
# Draws the text
txt = "Please, insert an object into the scene for testing!"
myGeClipMap.TextAt(50, 50, txt)
# Changes the font
bc = c4d.bitmaps.GeClipMap.GetDefaultFont(c4d.GE_FONT_DEFAULT_SYSTEM)
myGeClipMap.SetFont(bc, 50.0)
# Draws the text
myGeClipMap.TextAt(50, 150, txt)
# End the drawing
myGeClipMap.EndDraw()
return myGeClipMap
def main():
geClip = DrawText()
c4d.bitmaps.ShowBitmap(geClip.GetBitmap())
# Execute main()
if __name__=='__main__':
main()
Cheers,
Manuel