Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
136f041
Updates TEXT_BOLD to TEXT_WEIGHT in SettingNames.cs
pedropaulosuzuki Feb 3, 2026
05b3e18
Allow granular selection of font weight
pedropaulosuzuki Feb 3, 2026
97b9996
TextTool - Fix default font-weight
pedropaulosuzuki Feb 3, 2026
29d78f5
TextTool - Fix font-weight settings
pedropaulosuzuki Feb 3, 2026
2c92a8a
[Text Tool] Restore 'Ctrl+B' text weight shortcut
pedropaulosuzuki Feb 3, 2026
38f5ea0
[Text tool] Github being weird
pedropaulosuzuki Feb 3, 2026
32189b3
Text Tool - Restore Ctrl B text weight shortcut
pedropaulosuzuki Feb 3, 2026
e88b93b
Fix whitespace
pedropaulosuzuki Feb 3, 2026
5d007a2
Update CHANGELOG.md
pedropaulosuzuki Feb 3, 2026
caeaa71
Text Tool - Fix translations
pedropaulosuzuki Feb 3, 2026
8cfd298
Text tool - Make font-weight strings more clear for translators
pedropaulosuzuki Feb 5, 2026
ee8e0fc
Merge branch 'PintaProject:master' into master
pedropaulosuzuki Feb 7, 2026
9974226
[Text tool] Fix Ctrl+B shortcut changing to 'book' instead of 'normal'
pedropaulosuzuki Feb 9, 2026
10307da
Merge branch 'PintaProject:master' into master
pedropaulosuzuki Feb 9, 2026
ea63417
Merge branch 'PintaProject:master' into master
pedropaulosuzuki Feb 11, 2026
7020632
Update icon resources to include new custom font-weight icons
pedropaulosuzuki Feb 11, 2026
8d609b5
Set custom font-weight ToolBarDropDownButton icons
pedropaulosuzuki Feb 11, 2026
a70a8aa
Add credits to @yioannides in the README.md
pedropaulosuzuki Feb 11, 2026
018a125
Add font weight icons to the list of contributed icons
cameronwhite Feb 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Thanks to the following contributors who worked on this release:
- @spaghetti22
- @Matthieu-LAURENT39
- @jordanbrotherton
- @pedropaulosuzuki
- @yioannides

### Added
- The splatter brush now allows the minimum and maximum splatter size to be configured separately from the brush width
Expand All @@ -19,6 +21,7 @@ Thanks to the following contributors who worked on this release:
- Effect dialogs now hide options that are not currently relevant (#1960)
- Fixed several minor UX issues in the color dialog (#1795)
- The text tool now provides a separate adjustment for the font size, which doesn't require opening the font dialog (#1947, #1961)
- The text tool now allows choosing any font-weight supported by Cairo, not just Normal and Bold (#1965, #1967)

### Fixed
- Fixed a bug where duplicate submenus could be produced by add-ins with effect categories that were not translated (#1933, #1935)
Expand Down
7 changes: 6 additions & 1 deletion Pinta.Resources/Icons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public static class StandardIcons
public const string FormatJustifyLeft = "format-justify-left-symbolic";
public const string FormatJustifyCenter = "format-justify-center-symbolic";
public const string FormatJustifyRight = "format-justify-right-symbolic";
public const string FormatTextBold = "format-text-bold-symbolic";
public const string FormatTextItalic = "format-text-italic-symbolic";
public const string FormatTextUnderline = "format-text-underline-symbolic";

Expand Down Expand Up @@ -215,6 +214,12 @@ public static class Icons
public const string Sampling7 = "tool-colorpicker-sampling-7x7-symbolic";
public const string Sampling9 = "tool-colorpicker-sampling-9x9-symbolic";

public const string TextExtraLight = "text-extra-light-symbolic";
public const string TextLight = "text-light-symbolic";
public const string TextNormal = "text-normal-symbolic";
public const string TextBold = "text-bold-symbolic";
public const string TextExtraBold = "text-extra-bold-symbolic";

public const string ToolCloneStamp = "tool-clonestamp-symbolic";
public const string ToolColorPicker = "tool-colorpicker-symbolic";
public const string ToolColorPickerPreviousTool = "go-previous-symbolic";
Expand Down
5 changes: 5 additions & 0 deletions Pinta.Resources/icons/pinta-icons.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@
- hicolor/16x16/actions/effects-render-voronoidiagram.png
- hicolor/scalable/actions/tool-select-lasso-freeform-symbolic.png
- hicolor/scalable/actions/tool-select-lasso-polygon-symbolic.svg
- hicolor/scalable/actions/text-bold-symbolic.svg
- hicolor/scalable/actions/text-extra-bold-symbolic.svg
- hicolor/scalable/actions/text-extra-light-symbolic.svg
- hicolor/scalable/actions/text-light-symbolic.svg
- hicolor/scalable/actions/text-normal-symbolic.svg
2 changes: 1 addition & 1 deletion Pinta.Tools/SettingNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ internal static class SettingNames
internal const string PAINT_BRUSH_BRUSH = "paint-brush-brush";

internal const string TEXT_FONT = "text-font";
internal const string TEXT_BOLD = "text-bold";
internal const string TEXT_WEIGHT = "text-weight";
internal const string TEXT_ITALIC = "text-italic";
internal const string TEXT_UNDERLINE = "text-underline";
internal const string TEXT_ALIGNMENT = "text-alignment";
Expand Down
108 changes: 92 additions & 16 deletions Pinta.Tools/Tools/TextTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public TextTool (IServiceProvider services) : base (services)
private Gtk.Label font_label = null!;
private Gtk.FontDialogButton font_button = null!;
private Gtk.SpinButton font_size = null!;
private Gtk.ToggleButton bold_btn = null!;
private ToolBarDropDownButton weight_btn = null!;
private Gtk.ToggleButton italic_btn = null!;
private Gtk.ToggleButton underscore_btn = null!;
private Gtk.ToggleButton left_alignment_btn = null!;
Expand Down Expand Up @@ -192,17 +192,87 @@ protected override void OnBuildToolBar (Gtk.Box tb)

tb.Append (GtkExtensions.CreateToolBarSeparator ());

if (bold_btn == null) {
bold_btn = new Gtk.ToggleButton {
IconName = Pinta.Resources.StandardIcons.FormatTextBold,
TooltipText = Translations.GetString ("Bold"),
CanFocus = false,
Active = Settings.GetSetting (SettingNames.TEXT_BOLD, false),
};
bold_btn.OnToggled += HandleBoldButtonToggled;
if (weight_btn == null) {
weight_btn = new ToolBarDropDownButton ();

// Translators: 'Thin' (100) refers to the font-weight text property
weight_btn.AddItem (
Translations.GetString ("Thin") + " 100",
Pinta.Resources.Icons.TextExtraLight,
Pango.Weight.Thin
);
// Translators: 'Ultralight' (200) refers to the font-weight text property
weight_btn.AddItem (
Translations.GetString ("Ultralight") + " 200",
Pinta.Resources.Icons.TextExtraLight,
Pango.Weight.Ultralight
);
// Translators: 'Light' (300) refers to the font-weight text property
weight_btn.AddItem (
Translations.GetString ("Light") + " 300",
Pinta.Resources.Icons.TextLight,
Pango.Weight.Light
);
// Translators: 'Semilight' (350) refers to the font-weight text property
weight_btn.AddItem (
Translations.GetString ("Semilight") + " 350",
Pinta.Resources.Icons.TextLight,
Pango.Weight.Semilight
);
// Translators: 'Book' (380) refers to the font-weight text property
weight_btn.AddItem (
Translations.GetString ("Book") + " 380",
Pinta.Resources.Icons.TextNormal,
Pango.Weight.Book
);
// Translators: 'Normal' (400) refers to the font-weight text property
weight_btn.AddItem (
Translations.GetString ("Normal") + " 400",
Pinta.Resources.Icons.TextNormal,
Pango.Weight.Normal
);
// Translators: 'Medium' (500) refers to the font-weight text property
weight_btn.AddItem (
Translations.GetString ("Medium") + " 500",
Pinta.Resources.Icons.TextNormal,
Pango.Weight.Medium
);
// Translators: 'Semibold' (600) refers to the font-weight text property
weight_btn.AddItem (
Translations.GetString ("Semibold") + " 600",
Pinta.Resources.Icons.TextBold,
Pango.Weight.Semibold
);
// Translators: 'Bold' (700) refers to the font-weight text property
weight_btn.AddItem (
Translations.GetString ("Bold") + " 700",
Pinta.Resources.Icons.TextBold,
Pango.Weight.Bold
);
// Translators: 'Ultrabold' (800) refers to the font-weight text property
weight_btn.AddItem (
Translations.GetString ("Ultrabold") + " 800",
Pinta.Resources.Icons.TextExtraBold,
Pango.Weight.Ultrabold
);
// Translators: 'Heavy' (900) refers to the font-weight text property
weight_btn.AddItem (
Translations.GetString ("Heavy") + " 900",
Pinta.Resources.Icons.TextExtraBold,
Pango.Weight.Heavy
);
// Translators: 'Ultraheavy' (1000) refers to the font-weight text property
weight_btn.AddItem (
Translations.GetString ("Ultraheavy") + " 1000",
Pinta.Resources.Icons.TextExtraBold,
Pango.Weight.Ultraheavy
);

weight_btn.SelectedIndex = Settings.GetSetting (SettingNames.TEXT_WEIGHT, 5);
weight_btn.SelectedItemChanged += HandleWeightButtonToggled;
}

tb.Append (bold_btn);
tb.Append (weight_btn);

if (italic_btn == null) {
italic_btn = new Gtk.ToggleButton {
Expand Down Expand Up @@ -288,7 +358,7 @@ protected override void OnBuildToolBar (Gtk.Box tb)
fill_button.AddItem (Translations.GetString ("Fill Background"), Pinta.Resources.Icons.FillStyleBackground, 3);

fill_button.SelectedIndex = Settings.GetSetting (SettingNames.TEXT_STYLE, 0);
fill_button.SelectedItemChanged += HandleBoldButtonToggled;
fill_button.SelectedItemChanged += HandleFillButtonToggled;
}

tb.Append (fill_button);
Expand Down Expand Up @@ -336,8 +406,8 @@ protected override void OnSaveSettings (ISettingsService settings)
if (font_button is not null)
settings.PutSetting (SettingNames.TEXT_FONT, font_button.FontDesc!.ToString ()!);

if (bold_btn is not null)
settings.PutSetting (SettingNames.TEXT_BOLD, bold_btn.Active);
if (weight_btn is not null)
settings.PutSetting (SettingNames.TEXT_WEIGHT, weight_btn.SelectedIndex);

if (italic_btn is not null)
settings.PutSetting (SettingNames.TEXT_ITALIC, italic_btn.Active);
Expand Down Expand Up @@ -431,7 +501,12 @@ private void HandleItalicButtonToggled (object? sender, EventArgs e)
UpdateFont ();
}

private void HandleBoldButtonToggled (object? sender, EventArgs e)
private void HandleWeightButtonToggled (object? sender, EventArgs e)
{
UpdateFont ();
}

private void HandleFillButtonToggled (object? sender, EventArgs e)
{
outline_width.Visible = outline_width_label.Visible = outline_sep.Visible = StrokeText;

Expand All @@ -453,7 +528,7 @@ private void UpdateFont ()
if (workspace.HasOpenDocuments) {

var font = font_button.FontDesc!.Copy ()!; // NRT: Only nullable when nullptr is passed.
font.SetWeight (bold_btn.Active ? Pango.Weight.Bold : Pango.Weight.Normal);
font.SetWeight ((Pango.Weight) weight_btn.SelectedItem.GetTagOrDefault (Pango.Weight.Normal));
font.SetStyle (italic_btn.Active ? Pango.Style.Italic : Pango.Style.Normal);

CurrentTextEngine.SetFont (font, Alignment, underscore_btn.Active);
Expand Down Expand Up @@ -796,7 +871,8 @@ protected override bool OnKeyDown (Document document, ToolKeyEventArgs e)
italic_btn.Toggle ();
UpdateFont ();
} else if (e.Key.Value == Gdk.Constants.KEY_b) {
bold_btn.Toggle ();
// If current font-weight is Bold (8) or bolder, set to Normal (5). Otherwise, set to Bold (8).
weight_btn.SelectedIndex = weight_btn.SelectedIndex > 7 ? 5 : 8;
UpdateFont ();
} else if (e.Key.Value == Gdk.Constants.KEY_u) {
underscore_btn.Toggle ();
Expand Down
Loading