Skip to content

Commit

Permalink
Debug hebrew render
Browse files Browse the repository at this point in the history
  • Loading branch information
MatanZ committed Sep 19, 2022
1 parent a229d51 commit 51c4ac2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ android {

implementation project(":terminal-view")
implementation project(":termux-shared")
//implementation 'com.ibm.icu:icu4j:71.1'
}

defaultConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.termux.terminal.TextStyle;
import com.termux.terminal.WcWidth;

import android.util.Log;
/**
* Renderer of a {@link TerminalEmulator} into a {@link Canvas}.
* <p/>
Expand Down Expand Up @@ -121,6 +122,7 @@ public final void render(TerminalEmulator mEmulator, Canvas canvas, int topRow,
currentCharIndex += charsForCodePoint;
continue;
}
Log.w( "termux render", "char " + charAtIndex + " " + column + " w="+mTextPaint.measureText(line, currentCharIndex, charsForCodePoint)+ " fw="+mFontWidth );
final int codePointWcWidth = WcWidth.width(codePoint);
final boolean insideCursor = (cursorX == column || (codePointWcWidth == 2 && cursorX == column + 1));
final boolean insideSelection = column >= selx1 && column <= selx2;
Expand Down Expand Up @@ -173,6 +175,8 @@ public final void render(TerminalEmulator mEmulator, Canvas canvas, int topRow,
if (lastRunInsideCursor && cursorShape == TerminalEmulator.TERMINAL_CURSOR_STYLE_BLOCK) {
invertCursorTextColor = true;
}
Log.w("termux render", "len=" + charsSinceLastRun);

drawTextRun(canvas, line, palette, heightOffset, lastRunStartColumn, columnWidthSinceLastRun, lastRunStartIndex, charsSinceLastRun,
measuredWidthForRun, cursorColor, cursorShape, lastRunStyle, reverseVideo || invertCursorTextColor || lastRunInsideSelection);
}
Expand Down

0 comments on commit 51c4ac2

Please sign in to comment.