Recent posts

#31
Tutorials, Tips and How-Tos / Here's a SOLUTION to add/remov...
Last post by Greg P123 - August 31, 2024, 03:19:24 AM

Hi -

I got REALLY tired of the multiple mouse clicks to set/remove italics/bold, so I finally wrote a script to do it using keyboard shortcuts.

The script below will allow you to move up/down the font styles of your current font (cycling through Regular, Italics, Bold, etc).  Highlight your text and hit the shortcut -- that's it!

The script will work with Scribus in fullscreen mode or windowed - and on multi-monitor setups.

The script captures two keystrokes to go up/down the font styles (I used F5 and F6).  If you want to use other keystrokes, it's VERY easy to change (I describe how below).  The script will only capture the F5/F6 if Scribus is the active window, otherwise it passes the F5 and F6 through unchanged.

The whole 'intervention' requires just two files, and I'll share them here.  I'm running on Linux Mint, but this approach could be adapted for other OS's.  (If you do that, add your solution here!)

The two files are both located in the 'Home' folder (easy to find and work with).  They are '.xbindkeys' (to capture the keystrokes and call the script), and 'scribus_font_change.sh' (the script that does the work).  There is only one script because it gets called with a '1' or '2' parameter, depending on whether you want to go up or down the font styles.

Description of Method:

When I am editing text, I always have my Text Properties open on the right (and full height).  This means that the little arrow that activates the dropdown is always in the SAME POSITION relative to the top left right corner of the Scribus window.  This allows me to tell the script to 'click the mouse' on that dropdown arrow, go up/down using an arrow key, then hit 'Enter'.  Voila!

For my setup, the little dropdown arrow is 12 pixels to the left and 120 pixels below the top-right corner of the Scribus screen.  IF YOUR SETUP IS SLIGHTLY DIFFERENT, it's easy to adjust - just change the text of the script in one place.

First, capture the keystrokes:
Go to your Home folder, edit '.xbindkeys' and add these lines:

-----------------

"bash ~/scribus_font_change.sh 1"
   F5

"bash ~/scribus_font_change.sh 2"
   F6

-----------------

Next, create a file called 'scribus_font_change.sh' in the Home folder, add the lines below, and make the file executable.

-----------------

#!/bin/bash

# Check if a parameter is provided
if [ -z "$1" ]; then
  echo "Usage: $0 <parameter>"
  exit 1
fi

# Function to get the window ID under the mouse cursor
get_window_under_mouse() {
    xdotool getmouselocation --shell | grep WINDOW | sed 's/WINDOW=//'
}

# Function to click at a position relative to the window
click_at_position() {
    local window_id=$1
   
    # Get detailed window information
    win_info=$(xwininfo -id $window_id)
   
    # Extract window position and size
    X=$(echo "$win_info" | grep 'Absolute upper-left X' | awk '{print $NF}')
    Y=$(echo "$win_info" | grep 'Absolute upper-left Y' | awk '{print $NF}')
    WIDTH=$(echo "$win_info" | grep 'Width' | awk '{print $NF}')
   
    # Calculate click position relative to top-right corner
    click_x=$((X + WIDTH - 12))
    click_y=$((Y + 120))
   
    # Store current mouse position
    current_mouse=$(xdotool getmouselocation --shell)
    eval "$current_mouse"
   
    # Move mouse to calculated position and click
    xdotool mousemove $click_x $click_y click 1
   
    # Restore mouse position
    xdotool mousemove $X $Y
}

# Get the window ID under the mouse
WINDOW_ID=$(get_window_under_mouse)

# Check if Scribus is active or under the cursor
ACTIVE_WINDOW=$(xdotool getactivewindow getwindowname)
WINDOW_NAME=$(xdotool getwindowname $WINDOW_ID)

if [[ "$ACTIVE_WINDOW" == *"Scribus"* || "$WINDOW_NAME" == *"Scribus"* ]]; then
    # Perform actions based on the parameter
    case $1 in
        1)
            click_at_position $WINDOW_ID
            sleep 0.1
            xdotool key Up key Return
            ;;
        2)
            click_at_position $WINDOW_ID
            sleep 0.1
            xdotool key Down key Return
            ;;
        *)
            echo "Invalid parameter. Use 1 or 2."
            exit 1
            ;;
    esac
else
    # If not in Scribus, pass F5 for parameter 1 or F6 for parameter 2
    if [ "$1" -eq 1 ]; then
        xdotool key F5
    elif [ "$1" -eq 2 ]; then
        xdotool key F6
    fi
fi

-----------------

If you want to use keys other than F5/F6, then change the text that you add to '.xbindkeys' and the F5/F6 that appears at the very end of the script.

(You'll need to reset xbindkeys after any change to make the key capture active.)

If your screen setup is slightly different than mine, you may need to figure out where to 'mouse click' relative to the top-right corner (below the maximize button) - and change the offsets in the script (read the comments - it's easy to figure out).

Big thanks to Grok for it's help!  :)

I hope you enjoy.  It works GREAT over here.

- Greg
#32
PDF Generation / Re: Incorrectly Scaled Drop Sh...
Last post by AdmFubar - August 31, 2024, 02:38:21 AM
When exporting the pdf, are you selecting the colorspace model? there is an option for screen/web, printer. or greyscale.
#33
PDF Generation / Re: Incorrectly Scaled Drop Sh...
Last post by zeronop - August 30, 2024, 10:44:45 PM
Quote from: AdmFubar on August 30, 2024, 07:21:08 PMPer chance do you have color management turned on?

Turning off color management makes the example PDF file appear as it should after importing it (it was exported in a US Web Coated SWOP color space), but the softproof from the printer is still having the transparency issues in Scribus (Linux and Windows) after importing and after turning off color management. Adobe Acrobat reader and muPDF seem to be the only two applications that can render these shadows in the softproof PDF correctly.


Perhaps this an issue cropping up as the colorspace of the images is ignored or changed when it's being imported between back into Scribus, and there is probably a color space change happening with the printer company imports and exports out of Illustrator.

I understand that some PDF viewers handle different color spaces better than others, that explains why Okular, Chrome, and Firefox are having issues.

I did some snooping with the linux commandline tool pdfimages.  My original PDF that I sent to the printer shows that the images have an icc profile attached to them.  This is intentional, as I work with TIF formated CMYK images with a US Web Coated SWOP color profile attached to them.  On the other hand, the softproof PDF from the printer company, running through pdfimages, shows that these images are listed as just cmyk (as opposed to icc).  I imagine that this is causing issues at some level. 

Scribus imports the drop shadows and patterns.  I wish I could extract the images from these patterns in Scribus in order to examine how Scribus is interpreting the color of these drop shadows after it imports them from the PDF.
#34
User Interface / Re: Do you need inch input lik...
Last post by AdmFubar - August 30, 2024, 10:23:50 PM
just write it like math formula  2 1/2 would be written as 2+(1/2) it will convert to decimal as 2.5 in the input field.
#35
Installation and Setup / Re: scribus on 4k display
Last post by AdmFubar - August 30, 2024, 08:25:01 PM
You might want to try installin kvantum. I have it on my machine, but I just swapped out my 2k display for a 4k one to test(tv), but my system doesnt see allow the hight resolution :(. prolly need a graphics processor other then the one on the board, so I'm not sure if it will allow the enlargment like i suspect.
see:
https://store.kde.org/p/1005410


#36
Free discussion / Over 500 posts!
Last post by AdmFubar - August 30, 2024, 07:45:50 PM
I'm having cake!
#37
General Discussion / Re: [SOLVED] Need help - Scrib...
Last post by AdmFubar - August 30, 2024, 07:39:10 PM

I know that feeling well

https://youtu.be/VMosihNXzq4
#38
General Discussion / Re: Do you use cloud storage s...
Last post by AdmFubar - August 30, 2024, 07:35:05 PM
#39
PDF Generation / Re: Incorrectly Scaled Drop Sh...
Last post by AdmFubar - August 30, 2024, 07:21:08 PM
Per chance do you have color management turned on?
#40
Text and Typography / Re: Text frame spacing
Last post by Nermander - August 30, 2024, 07:15:17 PM
My guess is that QuarkXPress uses the height of the actual text, while Scribus uses the maximum height of the font.

I have a slight memory that in Scribus you can change this setting though.