diff --git a/docs/images/settings_overlay_demo.gif b/docs/images/settings_overlay_demo.gif index 80ac6d3..5672bec 100644 Binary files a/docs/images/settings_overlay_demo.gif and b/docs/images/settings_overlay_demo.gif differ diff --git a/examples/demo_settings_overlay.py b/examples/demo_settings_overlay.py index 5e7a0f8..7c1c21b 100644 --- a/examples/demo_settings_overlay.py +++ b/examples/demo_settings_overlay.py @@ -361,6 +361,49 @@ def main(): else: print(" Skipping - button not found") + # Get current overlay state for word spacing section + current_overlay3 = reader.get_current_page() + + # Frame W: Tap on word spacing increase button + print("Frame W: Tap on word spacing increase...") + if 'setting:word_spacing_increase' in link_positions: + tap_x4, tap_y4 = link_positions['setting:word_spacing_increase'] + print(f" Using coordinates: ({tap_x4}, {tap_y4})") + + tap_visual4 = add_tap_indicator(current_overlay3, tap_x4, tap_y4, "Increase") + annotated_ws_tap = add_gesture_annotation(tap_visual4, "Tap to increase word spacing", "bottom") + frames.append(annotated_ws_tap) + frame_duration.append(1500) # 1.5 seconds + + # Frames W+1 to W+5: Word spacing increased (live preview) - show each tap individually + print("Frames W+1 to W+5: Word spacing increased with live preview (5 taps, showing each)...") + for i in range(5): + event_tap_word = TouchEvent(gesture=GestureType.TAP, x=tap_x4, y=tap_y4) + response = reader.handle_touch(event_tap_word) + print(f" Tap {i+1}: {response.action} - Word spacing: {response.data.get('word_spacing', 'N/A')}") + + # Get updated overlay image after each tap + updated_overlay4 = reader.get_current_page() + annotated = add_gesture_annotation( + updated_overlay4, + f"Word Spacing: {reader.page_style.word_spacing}px (tap {i+1}/5)", + "top" + ) + frames.append(annotated) + frame_duration.append(800) # 0.8 seconds per tap + + # Hold on final word spacing for a bit longer + final_word_overlay = reader.get_current_page() + annotated_final_ws = add_gesture_annotation( + final_word_overlay, + f"Word Spacing: {reader.page_style.word_spacing}px (complete)", + "top" + ) + frames.append(annotated_final_ws) + frame_duration.append(1500) # 1.5 seconds to see the final result + else: + print(" Skipping - button not found") + # Frame Z: Tap outside to close print("Frame Z: Close overlay...") final_overlay_state = reader.get_current_page() @@ -378,7 +421,7 @@ def main(): final_page = reader.get_current_page() annotated_final = add_gesture_annotation( final_page, - f"Settings Applied: {int(reader.base_font_scale * 100)}% font, {reader.page_style.line_spacing}px line, {reader.page_style.inter_block_spacing}px para", + f"Settings Applied: {int(reader.base_font_scale * 100)}% font, {reader.page_style.line_spacing}px line, {reader.page_style.inter_block_spacing}px para, {reader.page_style.word_spacing}px word", "top" ) frames.append(annotated_final)