View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0017607 | Scribus | General | public | 2025-08-25 21:48 | 2025-08-26 07:56 |
Reporter | tifain | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | new | Resolution | open | ||
Product Version | 1.6.4 | ||||
Summary | 0017607: SCrip python problem with scribus.setFont ? | ||||
Description | SCrip python problem with scribus.setFont ? | ||||
Steps To Reproduce | # Vérifiez que Scribus est en mode script if not scribus.haveDoc(): scribus.messageBox("Erreur", "Aucun document ouvert.") else: # Définir les paramètres de la table rows = 4 cols = 25 start_value = 1 end_value = 100 value = start_value # Créer une nouvelle page scribus.newPage(-1) # Définir la largeur et la hauteur des cellules cell_width = 10 # largeur de chaque cellule cell_height = 5 # hauteur de chaque cellule # Boucle pour créer les cellules for row in range(rows): for col in range(cols): if value <= end_value: # Calculer la position de la cellule x = col * cell_width y = row * cell_height # Créer un cadre de texte pour chaque valeur text_frame = scribus.createText(x, y, cell_width, cell_height) scribus.setText(str(value), text_frame) # Appliquer le style de texte scribus.setFont("Times-Roman", text_frame) scribus.setFontSize(9, text_frame) # Taille de la police en pouces scribus.setLeading(12, text_frame) # Interlignage en pouces # Incrémenter la valeur value += 1 scribus.messageBox("Succès", "Table de valeurs créée avec succès.") | ||||
Tags | No tags attached. | ||||
Patch | No | ||||
|
I guess that Times-Roman is not a "font". I've tried to replace it with "DejaVu Sans Book" that exist on my system and, then it goes through that line. Just make sure that you type a valid Family and Style. And setLeading() does not exist. Finally, there are so many odd things in your script that I wonder if you're a bot or if you just used some AI to generate the script, without really understanding what it does. |