diff --git a/ReadMe.txt b/ReadMe.txt index 7287ebb..a67de97 100644 --- a/ReadMe.txt +++ b/ReadMe.txt @@ -66,6 +66,8 @@ Version 1.5 (2019-06-xx) - Prevent the ESC key from leaving the application (Github Fix: #6). - Map the keyboard DELETE key like it should (Github Fix: #6). - Map the +, -, * and / keys catching the typed character instead of the virtual key (Github Fix: #6). +- Fix the printer icon in the Eric's script "real49gp-lc.kml" and "real50g-lc.kml". +- Improve the swipe gesture. Version 1.4 (2019-06-08) @@ -146,12 +148,20 @@ Note: some included files are not covered by the GPL; these include ROM image fi The Eric's Real scripts ("real*.kml" and "real*.bmp/png") are embedded in this application with the kind permission of Eric Rechlin. +DONE + +- Cleanup code. +- Auto-scroll down the textual printer. +- Fix the printer icon in the Eric's script "real49gp-lc.kml" and "real50g-lc.kml". +- Improve the swipe gesture. + + TODO +- With HP49, On+D does not work even with version 2.10 (2.15 should not work)! - In Chrome OS: - The timezone seems to be GMT (localtime_r not right?)! - sometimes there is no OK button in the KML Script Compilation Result. -- Improve the swipe gesture. - The clock seems unsynchronized sometimes. - Add KML script loading dependencies fallback to the inner ROM (and may be KML include?). - Add a separation between the pixels (Suggestion from Jaime Meza). diff --git a/app/src/main/assets/calculators/About these files b/app/src/main/assets/calculators/About these files deleted file mode 100644 index bdf047f..0000000 --- a/app/src/main/assets/calculators/About these files +++ /dev/null @@ -1 +0,0 @@ -This folder contains several files usefull for emu48 mor the mac. It contains kml, kmi, bitmaps, rom files for 48SX, 48GX, 49G, 38G, 39G, 40G The roms are copyrighted Hewlett-Packard Other files are property of their respective authors. \ No newline at end of file diff --git a/app/src/main/assets/calculators/real49gp-lc.kml b/app/src/main/assets/calculators/real49gp-lc.kml index 18ae60a..1e656cf 100644 --- a/app/src/main/assets/calculators/real49gp-lc.kml +++ b/app/src/main/assets/calculators/real49gp-lc.kml @@ -83,37 +83,37 @@ End Annunciator 1 Size 24 18 - Offset 84 2 + Offset 40 2 Down 443 927 End Annunciator 2 Size 24 18 - Offset 147 2 + Offset 103 2 Down 467 927 End Annunciator 3 Size 24 18 - Offset 220 2 + Offset 176 2 Down 491 927 End Annunciator 4 Size 24 18 - Offset 290 2 + Offset 246 2 Down 515 927 End Annunciator 5 Size 24 18 - Offset 355 2 + Offset 311 2 Down 539 927 End Annunciator 6 Size 24 18 - Offset 424 2 + Offset 380 2 Down 564 927 End diff --git a/app/src/main/assets/calculators/real50g-lc.kml b/app/src/main/assets/calculators/real50g-lc.kml index 28f6976..36140dc 100644 --- a/app/src/main/assets/calculators/real50g-lc.kml +++ b/app/src/main/assets/calculators/real50g-lc.kml @@ -115,7 +115,7 @@ End Annunciator 6 Size 24 17 Offset 377 3 - Down 457 923 + Down 557 923 End Button 11 diff --git a/app/src/main/cpp/emu-jni.c b/app/src/main/cpp/emu-jni.c index 9547e62..5b53da5 100644 --- a/app/src/main/cpp/emu-jni.c +++ b/app/src/main/cpp/emu-jni.c @@ -932,8 +932,6 @@ JNIEXPORT jint JNICALL Java_org_emulator_calculator_NativeLib_onViewScript(JNIEn ResetDocument(); // close document SetWindowTitle(NULL); } -// mainViewResizeCallback(nBackgroundW, nBackgroundH); - //draw(); //TODO CRASH return result; } diff --git a/app/src/main/cpp/win32-layer.h b/app/src/main/cpp/win32-layer.h index 5874f3d..7d8e88a 100644 --- a/app/src/main/cpp/win32-layer.h +++ b/app/src/main/cpp/win32-layer.h @@ -575,24 +575,11 @@ typedef struct _HANDLE * HANDLE; typedef HANDLE HMENU; typedef HANDLE HINSTANCE; -//typedef HANDLE HWND; typedef HANDLE HCURSOR; typedef HANDLE HLOCAL; //TODO typedef struct _OVERLAPPED { -/* - ULONG_PTR Internal; - ULONG_PTR InternalHigh; - union { - struct { - DWORD Offset; - DWORD OffsetHigh; - } DUMMYSTRUCTNAME; - PVOID Pointer; - } DUMMYUNIONNAME; -*/ - HANDLE hEvent; } OVERLAPPED, *LPOVERLAPPED; diff --git a/app/src/main/java/org/emulator/calculator/MainScreenView.java b/app/src/main/java/org/emulator/calculator/MainScreenView.java index 5ee3998..2192358 100644 --- a/app/src/main/java/org/emulator/calculator/MainScreenView.java +++ b/app/src/main/java/org/emulator/calculator/MainScreenView.java @@ -14,6 +14,7 @@ package org.emulator.calculator; +import android.annotation.SuppressLint; import android.app.Activity; import android.content.Context; import android.content.pm.ActivityInfo; @@ -23,6 +24,7 @@ import android.graphics.Color; import android.graphics.Paint; import android.util.DisplayMetrics; import android.util.Log; +import android.util.SparseIntArray; import android.view.KeyEvent; import android.view.MotionEvent; @@ -37,7 +39,7 @@ public class MainScreenView extends PanAndScaleView { private Paint paint = new Paint(); private Bitmap bitmapMainScreen; - private HashMap vkmap; + private SparseIntArray vkmap; private HashMap charmap; private int kmlBackgroundColor = Color.BLACK; private boolean useKmlBackgroundColor = false; @@ -69,7 +71,7 @@ public class MainScreenView extends PanAndScaleView { charmap.put('*', 0x6A); // VK_MULTIPLY charmap.put('/', 0x6F); // VK_DIVIDE - vkmap = new HashMap<>(); + vkmap = new SparseIntArray(); //vkmap.put(KeyEvent.KEYCODE_BACK, 0x08); // VK_BACK vkmap.put(KeyEvent.KEYCODE_TAB, 0x09); // VK_TAB vkmap.put(KeyEvent.KEYCODE_ENTER, 0x0D); // VK_RETURN @@ -87,16 +89,6 @@ public class MainScreenView extends PanAndScaleView { vkmap.put(KeyEvent.KEYCODE_DPAD_UP, 0x26); // VK_UP vkmap.put(KeyEvent.KEYCODE_DPAD_RIGHT, 0x27); // VK_RIGHT vkmap.put(KeyEvent.KEYCODE_DPAD_DOWN, 0x28); // VK_DOWN -// vkmap.put(KeyEvent.KEYCODE_0, 0x30); // 0 -// vkmap.put(KeyEvent.KEYCODE_1, 0x31); // 1 -// vkmap.put(KeyEvent.KEYCODE_2, 0x32); // 2 -// vkmap.put(KeyEvent.KEYCODE_3, 0x33); // 3 -// vkmap.put(KeyEvent.KEYCODE_4, 0x34); // 4 -// vkmap.put(KeyEvent.KEYCODE_5, 0x35); // 5 -// vkmap.put(KeyEvent.KEYCODE_6, 0x36); // 6 -// vkmap.put(KeyEvent.KEYCODE_7, 0x37); // 7 -// vkmap.put(KeyEvent.KEYCODE_8, 0x38); // 8 -// vkmap.put(KeyEvent.KEYCODE_9, 0x39); // 9 vkmap.put(KeyEvent.KEYCODE_A, 0x41); // A vkmap.put(KeyEvent.KEYCODE_B, 0x42); // B vkmap.put(KeyEvent.KEYCODE_C, 0x43); // C @@ -165,39 +157,17 @@ public class MainScreenView extends PanAndScaleView { // This call is necessary, or else the // draw method will not be called. setWillNotDraw(false); - -// scroller.setFriction(0.00001f); // ViewConfiguration.getScrollFriction(); // ViewConfiguration.SCROLL_FRICTION = 0.015f; -// setOnTapDownListener(new OnTapListener() { -// @Override -// public boolean onTap(View v, float x, float y) { -// if(NativeLib.buttonDown((int)x, (int)y)) { -// if(debug) Log.d(TAG, "onTapDown() true"); -// return true; -// } -// if(debug) Log.d(TAG, "onTapDown() false"); -// return false; -// } -// }); - -// setOnTapUpListener(new OnTapListener() { -// @Override -// public boolean onTap(View v, float x, float y) { -// if(debug) Log.d(TAG, "onTapUp()"); -// NativeLib.buttonUp((int)x, (int)y); -// return false; -// } -// }); } - protected Set currentButtonTouched = new HashSet(); + // Prevent accidental scroll when taping a calc button + protected Set currentButtonTouched = new HashSet<>(); + @SuppressLint("ClickableViewAccessibility") public boolean onTouchEvent(MotionEvent event) { int actionIndex = event.getActionIndex(); int action = event.getActionMasked(); switch (action) { case MotionEvent.ACTION_DOWN: case MotionEvent.ACTION_POINTER_DOWN: - //Log.d(TAG, "ACTION_DOWN/ACTION_POINTER_DOWN count: " + touchCount + ", actionIndex: " + actionIndex); - //NativeLib.buttonDown((int)((event.getX(actionIndex) - screenOffsetX) / screenScaleX), (int)((event.getY(actionIndex) - screenOffsetY) / screenScaleY)); currentButtonTouched.remove(actionIndex); if(actionIndex == 0 && event.getPointerCount() == 1) currentButtonTouched.clear(); @@ -205,8 +175,6 @@ public class MainScreenView extends PanAndScaleView { (int) ((event.getY(actionIndex) - viewPanOffsetY) / viewScaleFactorY))) { currentButtonTouched.add(actionIndex); preventToScroll = true; -// if (debug) Log.d(TAG, "onTouchEvent() ACTION_DOWN true, actionIndex: " + actionIndex + ", currentButtonTouched: " + currentButtonTouched.size()); -// return true; } if (debug) Log.d(TAG, "onTouchEvent() ACTION_DOWN false, actionIndex: " + actionIndex + ", currentButtonTouched: " + currentButtonTouched.size() @@ -214,8 +182,6 @@ public class MainScreenView extends PanAndScaleView { break; case MotionEvent.ACTION_UP: case MotionEvent.ACTION_POINTER_UP: - //Log.d(TAG, "ACTION_UP/ACTION_POINTER_UP count: " + touchCount + ", actionIndex: " + actionIndex); - //NativeLib.buttonUp((int)((event.getX(actionIndex) - screenOffsetX) / screenScaleX), (int)((event.getY(actionIndex) - screenOffsetY) / screenScaleY)); NativeLib.buttonUp((int) ((event.getX(actionIndex) - viewPanOffsetX) / viewScaleFactorX), (int) ((event.getY(actionIndex) - viewPanOffsetY) / viewScaleFactorY)); currentButtonTouched.remove(actionIndex); preventToScroll = currentButtonTouched.size() > 0; @@ -236,14 +202,13 @@ public class MainScreenView extends PanAndScaleView { public boolean onKeyDown(int keyCode, KeyEvent event) { if((event.getFlags() & KeyEvent.FLAG_VIRTUAL_HARD_KEY) == 0) { char pressedKey = (char) event.getUnicodeChar(); - //Log.d(TAG, "onKeyDown is: " + pressedKey); + if(debug) Log.d(TAG, "onKeyDown is: " + pressedKey); Integer windowsKeycode = charmap.get(pressedKey); if(windowsKeycode == null) windowsKeycode = vkmap.get(keyCode); - if (windowsKeycode != null) + if (windowsKeycode != 0) NativeLib.keyDown(windowsKeycode); - else - Log.e(TAG, String.format("Unknown keyCode: %d", keyCode)); + else if(debug) Log.e(TAG, String.format("Unknown keyCode: %d", keyCode)); } if(keyCode == KeyEvent.KEYCODE_BACK) return true; @@ -254,14 +219,13 @@ public class MainScreenView extends PanAndScaleView { public boolean onKeyUp(int keyCode, KeyEvent event) { if((event.getFlags() & KeyEvent.FLAG_VIRTUAL_HARD_KEY) == 0) { char pressedKey = (char) event.getUnicodeChar(); - //Log.d(TAG, "onKeyUp is: " + pressedKey); + if(debug) Log.d(TAG, "onKeyUp is: " + pressedKey); Integer windowsKeycode = charmap.get(pressedKey); if(windowsKeycode == null) windowsKeycode = vkmap.get(keyCode); - if (windowsKeycode != null) + if (windowsKeycode != 0) NativeLib.keyUp(windowsKeycode); - else - Log.e(TAG, String.format("Unknown keyCode: %d", keyCode)); + else if(debug) Log.e(TAG, String.format("Unknown keyCode: %d", keyCode)); } if(keyCode == KeyEvent.KEYCODE_BACK) return true; @@ -270,8 +234,6 @@ public class MainScreenView extends PanAndScaleView { @Override protected void onSizeChanged(int viewWidth, int viewHeight, int oldViewWidth, int oldViewHeight) { -// super.onSizeChanged(viewWidth, viewHeight, oldViewWidth, oldViewHeight); - viewSizeWidth = viewWidth; viewSizeHeight = viewHeight; @@ -325,8 +287,6 @@ public class MainScreenView extends PanAndScaleView { constrainPan(); return; } - } else { - //((Activity) getContext()).setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); } } } @@ -350,7 +310,8 @@ public class MainScreenView extends PanAndScaleView { final int CALLBACK_TYPE_INVALIDATE = 0; final int CALLBACK_TYPE_WINDOW_RESIZE = 1; - int updateCallback(int type, int param1, int param2, String param3, String param4) { + @SuppressWarnings("unused") + public int updateCallback(int type, int param1, int param2, String param3, String param4) { switch (type) { case CALLBACK_TYPE_INVALIDATE: //Log.d(TAG, "PAINT updateCallback() postInvalidate()"); diff --git a/app/src/main/java/org/emulator/calculator/PanAndScaleView.java b/app/src/main/java/org/emulator/calculator/PanAndScaleView.java index eeb71bc..d17e090 100644 --- a/app/src/main/java/org/emulator/calculator/PanAndScaleView.java +++ b/app/src/main/java/org/emulator/calculator/PanAndScaleView.java @@ -14,6 +14,7 @@ package org.emulator.calculator; +import android.annotation.SuppressLint; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; @@ -85,7 +86,13 @@ public class PanAndScaleView extends View { protected boolean firstTime = false; protected boolean viewHasChanged() { - if(viewPanOffsetX != previousViewPanOffsetX || viewPanOffsetY != previousViewPanOffsetY || viewScaleFactorX != previousViewScaleFactorX || viewScaleFactorY != previousViewScaleFactorY) { + if((int)viewPanOffsetX != (int)previousViewPanOffsetX || (int)viewPanOffsetY != (int)previousViewPanOffsetY + || (int)viewScaleFactorX != (int)previousViewScaleFactorX || (int)viewScaleFactorY != (int)previousViewScaleFactorY) { + if(debug) Log.d(TAG, "viewHasChanged() previousViewPanOffsetX: " + previousViewPanOffsetX + ", viewPanOffsetX: " + viewPanOffsetX + + ", previousViewPanOffsetY: " + previousViewPanOffsetY + ", viewPanOffsetY: " + viewPanOffsetY + + ", previousViewScaleFactorX: " + previousViewScaleFactorX + ", previousViewScaleFactorY: " + previousViewScaleFactorY + + ", previousViewScaleFactorY: " + previousViewScaleFactorY + ", viewScaleFactorY: " + viewScaleFactorY); + previousViewPanOffsetX = viewPanOffsetX; previousViewPanOffsetY = viewPanOffsetY; previousViewScaleFactorX = viewScaleFactorX; @@ -126,6 +133,7 @@ public class PanAndScaleView extends View { * Register a callback to be invoked when this view is tapped down. * @param onTapDownListener The callback that will run */ + @SuppressWarnings("unused") public void setOnTapDownListener(OnTapListener onTapDownListener) { this.onTapDownListener = onTapDownListener; } @@ -134,30 +142,37 @@ public class PanAndScaleView extends View { * Register a callback to be invoked when this view is tapped up. * @param onTapUpListener The callback that will run */ + @SuppressWarnings("unused") public void setOnTapUpListener(OnTapListener onTapUpListener) { this.onTapUpListener = onTapUpListener; } + @SuppressWarnings("unused") public float getMaxZoom() { return maxZoom; } - + + @SuppressWarnings("unused") public void setMaxZoom(float maxZoom) { this.maxZoom = maxZoom; } - + + @SuppressWarnings("unused") public boolean getShowCursor() { return showCursor; } - + + @SuppressWarnings("unused") public void setShowCursor(boolean showCursor) { this.showCursor = showCursor; } - + + @SuppressWarnings("unused") public PointF getCursorLocation() { return cursorLocation; } + @SuppressWarnings("unused") public void setCursorLocation(float x, float y) { cursorLocation.set(x, y); } @@ -165,6 +180,7 @@ public class PanAndScaleView extends View { /** * @return true to show a small scale thumbnail in the bottom right; false otherwise. */ + @SuppressWarnings("unused") public boolean getShowScaleThumbnail() { return showScaleThumbnail; } @@ -172,6 +188,7 @@ public class PanAndScaleView extends View { /** * @param showScaleThumbnail true to show a small scale thumbnail in the bottom right; false otherwise. */ + @SuppressWarnings("unused") public void setShowScaleThumbnail(boolean showScaleThumbnail) { this.showScaleThumbnail = showScaleThumbnail; } @@ -179,6 +196,7 @@ public class PanAndScaleView extends View { /** * @return true to allow to zoom when double tapping; false otherwise. */ + @SuppressWarnings("unused") public boolean getAllowDoubleTapZoom() { return allowDoubleTapZoom; } @@ -186,6 +204,7 @@ public class PanAndScaleView extends View { /** * @param allowDoubleTapZoom true to allow to zoom when double tapping; false otherwise. */ + @SuppressWarnings("unused") public void setAllowDoubleTapZoom(boolean allowDoubleTapZoom) { this.allowDoubleTapZoom = allowDoubleTapZoom; } @@ -194,6 +213,7 @@ public class PanAndScaleView extends View { /** * @return true to allow the virtual space to fill view bounds the ; false otherwise. */ + @SuppressWarnings("unused") public boolean getFillBounds() { return fillBounds; } @@ -201,6 +221,7 @@ public class PanAndScaleView extends View { /** * @param fillBounds true to allow the virtual space to fill the view bounds; false otherwise. */ + @SuppressWarnings("unused") public void setFillBounds(boolean fillBounds) { this.fillBounds = fillBounds; } @@ -208,6 +229,7 @@ public class PanAndScaleView extends View { /** * @return true to allow to pan and scale; false otherwise. */ + @SuppressWarnings("unused") public boolean getEnablePanAndScale() { return enablePanAndScale; } @@ -276,7 +298,7 @@ public class PanAndScaleView extends View { @Override public boolean onDown(MotionEvent e) { - if(debug) Log.d(TAG, "onDown() actionIndex: " + e.getActionIndex()); + if(debug) Log.d(TAG, "onDown() actionIndex: " + e.getActionIndex() + ", X: " + e.getX() + ", Y: " + e.getY()); scroller.forceFinished(true); ViewCompat.postInvalidateOnAnimation(PanAndScaleView.this); if(onTapDownListener != null) { @@ -288,14 +310,9 @@ public class PanAndScaleView extends View { return super.onDown(e); } -// @Override -// public void onShowPress(MotionEvent e) { -// super.onShowPress(e); -// } - @Override public boolean onSingleTapConfirmed(MotionEvent e) { - if(debug) Log.d(TAG, "onSingleTapConfirmed() actionIndex: " + e.getActionIndex()); + if(debug) Log.d(TAG, "onSingleTapConfirmed() actionIndex: " + e.getActionIndex() + ", X: " + e.getX() + ", Y: " + e.getY()); if(onTapUpListener != null) { float scaleAndPanX = (e.getX() - viewPanOffsetX) / viewScaleFactorX; float scaleAndPanY = (e.getY() - viewPanOffsetY) / viewScaleFactorY; @@ -308,7 +325,7 @@ public class PanAndScaleView extends View { @Override public boolean onDoubleTap(MotionEvent e) { - if(debug) Log.d(TAG, "onDoubleTap() actionIndex: " + e.getActionIndex()); + if(debug) Log.d(TAG, "onDoubleTap() actionIndex: " + e.getActionIndex() + ", X: " + e.getX() + ", Y: " + e.getY()); if(!allowDoubleTapZoom || fillBounds) return false; float scaleFactorPreviousX = viewScaleFactorX; @@ -328,7 +345,11 @@ public class PanAndScaleView extends View { @Override public boolean onScroll(MotionEvent downEvent, MotionEvent moveEvent, float distanceX, float distanceY) { - if(debug) Log.d(TAG, "onScroll() downEvent.actionIndex: " + (downEvent != null ? downEvent.getActionIndex() : "null") + ", moveEvent.actionIndex: " + (downEvent != null ? moveEvent.getActionIndex() : "null")); + if(debug) + Log.d(TAG, "onScroll() downEvent.actionIndex: " + (downEvent != null ? downEvent.getActionIndex() : "null") + + ", moveEvent.actionIndex: " + (downEvent != null ? moveEvent.getActionIndex() : "null") + + ", distanceX: " + distanceX + ", distanceY: " + distanceY + ); if(fillBounds || preventToScroll) return false; @@ -355,10 +376,10 @@ public class PanAndScaleView extends View { + ", minX: " + viewPanMinX + ", maxX: " + 0 + ", minY: " + viewPanMinY + ", maxY: " + 0 + ")"); - scroller.fling((int) viewPanOffsetX, (int) viewPanOffsetY, + scroller.fling(-(int)viewPanOffsetX, -(int)viewPanOffsetY, (int)(velocityFactor * velocityX), (int)(velocityFactor * velocityY), - (int)viewPanMinX, 0, - (int)viewPanMinY, 0); + 0, -(int)viewPanMinX, + 0, -(int)viewPanMinY); ViewCompat.postInvalidateOnAnimation(PanAndScaleView.this); return true; } @@ -367,8 +388,7 @@ public class PanAndScaleView extends View { this.setFocusable(true); this.setFocusableInTouchMode(true); - // This call is necessary, or else the - // draw method will not be called. + // This call is necessary, or else the draw method will not be called. setWillNotDraw(false); } @@ -412,6 +432,7 @@ public class PanAndScaleView extends View { invalidate(); } + @SuppressWarnings("unused") public void postDoScroll(float deltaX, float deltaY, boolean center) { if(fillBounds) return; @@ -423,9 +444,11 @@ public class PanAndScaleView extends View { postInvalidate(); } + @SuppressLint("ClickableViewAccessibility") @Override public boolean onTouchEvent(MotionEvent event) { if(enablePanAndScale) { + // The order of operations is important boolean result = scaleDetector.onTouchEvent(event); result = gestureDetector.onTouchEvent(event) || result; return result || super.onTouchEvent(event); @@ -436,14 +459,12 @@ public class PanAndScaleView extends View { @Override public boolean onGenericMotionEvent(MotionEvent event) { if (enablePanAndScale && !fillBounds && (event.getSource() & InputDevice.SOURCE_CLASS_POINTER) != 0) { - //if (event.isFromSource(InputDevice.SOURCE_CLASS_POINTER)) { - switch (event.getAction()) { - case MotionEvent.ACTION_SCROLL: + if (event.getAction() == MotionEvent.ACTION_SCROLL) { float wheelDelta = event.getAxisValue(MotionEvent.AXIS_VSCROLL); - if(wheelDelta > 0f) - scaleByStep(scaleStep, event.getX(), event.getY()); - else if(wheelDelta < 0f) - scaleByStep(1.0f / scaleStep, event.getX(), event.getY()); + if (wheelDelta > 0f) + scaleByStep(scaleStep, event.getX(), event.getY()); + else if (wheelDelta < 0f) + scaleByStep(1.0f / scaleStep, event.getX(), event.getY()); return true; } @@ -466,12 +487,7 @@ public class PanAndScaleView extends View { return super.onKeyUp(keyCode, event); } - /** - * Scale the view step by step following the mouse/touch position - * @param scaleFactor - * @param x - * @param y - */ + // Scale the view step by step following the mouse/touch position private void scaleByStep(float scaleFactor, float x, float y) { float scaleFactorPreviousX = viewScaleFactorX; float scaleFactorPreviousY = viewScaleFactorY; @@ -490,9 +506,6 @@ public class PanAndScaleView extends View { } private void scaleWithFocus(float focusX, float focusY, float scaleFactorPreviousX, float scaleFactorPreviousY) { - //float centeredScaleFactor = 1f - viewScaleFactor / scaleFactorPrevious; - //viewPanOffsetX += (focusX - viewPanOffsetX) * centeredScaleFactor; - //viewPanOffsetY += (focusY - viewPanOffsetY) * centeredScaleFactor; viewPanOffsetX = viewPanOffsetX + (focusX - viewPanOffsetX) - (focusX - viewPanOffsetX) * viewScaleFactorX / scaleFactorPreviousX; viewPanOffsetY = viewPanOffsetY + (focusY - viewPanOffsetY) - (focusY - viewPanOffsetY) * viewScaleFactorY / scaleFactorPreviousY; } @@ -616,6 +629,7 @@ public class PanAndScaleView extends View { @Override protected void onSizeChanged(int viewWidth, int viewHeight, int oldViewWidth, int oldViewHeight) { + if(debug) Log.d(TAG, "onSizeChanged(viewWidth: " + viewWidth + ", viewHeight: " + viewHeight + ", oldViewWidth: " + oldViewWidth + ", oldViewHeight: " + oldViewHeight + ")"); super.onSizeChanged(viewWidth, viewHeight, oldViewWidth, oldViewHeight); viewSizeWidth = viewWidth; @@ -674,9 +688,6 @@ public class PanAndScaleView extends View { viewSizeHeight - marginY ); canvas.drawRect(rectScaleImage, paint); -// rectBitmapSource.set(0, 0, (int) virtualSizeWidth, (int) virtualSizeHeight); -// if(mBitmap != null) -// canvas.drawBitmap(mBitmap, rectBitmapSource, rectScaleImage, paint); rectScaleView.set(rectScaleImage.left + scale * (-viewPanOffsetX / viewScaleFactorX), rectScaleImage.top + scale * (-viewPanOffsetY / viewScaleFactorY), rectScaleImage.left + scale * (viewSizeWidth - viewPanOffsetX) / viewScaleFactorX, diff --git a/app/src/main/java/org/emulator/calculator/PrinterSimulator.java b/app/src/main/java/org/emulator/calculator/PrinterSimulator.java index 6e3a7de..726c746 100644 --- a/app/src/main/java/org/emulator/calculator/PrinterSimulator.java +++ b/app/src/main/java/org/emulator/calculator/PrinterSimulator.java @@ -83,7 +83,7 @@ public class PrinterSimulator { /** * Change the paper, so we cleanup everything. */ - public void changePaper() { + void changePaper() { reset(); m_Text.setLength(0); mBitmap.eraseColor(0xFFFFFFFF); @@ -107,7 +107,7 @@ public class PrinterSimulator { * Register a callback to be invoked when the printer just has print something. * @param onPrinterUpdateListener The callback that will run */ - public void setOnPrinterUpdateListener(OnPrinterUpdateListener onPrinterUpdateListener) { + void setOnPrinterUpdateListener(OnPrinterUpdateListener onPrinterUpdateListener) { this.onPrinterUpdateListener = onPrinterUpdateListener; } @@ -134,7 +134,7 @@ public class PrinterSimulator { /** * Reset the printer state machine. */ - void reset() { + private void reset() { m_bExpChar = false; // printing normal-width characters m_bUnderLined = false; // printing non underlined characters @@ -150,7 +150,7 @@ public class PrinterSimulator { /** * Printer self test. */ - void selftest() { + private void selftest() { // self test normally run in an endless loop, that's very hard to implement, // so this implementation printing all characters only one time and then // go back to the communication interface @@ -182,7 +182,7 @@ public class PrinterSimulator { /** * Entry point of the data coming in the printer. - * @param byData + * @param byData The characters to write to the printer. */ public synchronized void write(int byData) { @@ -260,7 +260,7 @@ public class PrinterSimulator { /** * ROMAN8 Unicode table */ - static final int[] wcRoman8 = new int[] + private static final int[] wcRoman8 = new int[] { 0x00A0, 0x00F7, 0x00D7, 0x221A, 0x222B, 0x03A3, 0x25B6, 0x03C0, 0x2202, 0x2264, 0x2265, 0x2260, 0x03B1, 0x2192, 0x2190, 0x00B5, @@ -283,7 +283,7 @@ public class PrinterSimulator { /** * ECMA94 Unicode table */ - static final int[] wcEcma94 = new int[] + private static final int[] wcEcma94 = new int[] { 0x2221, 0x0101, 0x2207, 0x221A, 0x222B, 0x03A3, 0x25B6, 0x03C0, 0x2202, 0x2264, 0x2265, 0x2260, 0x03B1, 0x2192, 0x2190, 0x2193, @@ -323,7 +323,7 @@ public class PrinterSimulator { else { byData -= 128; // index to table - if (m_bEcma94 == false) + if (!m_bEcma94) textUpdate.append((char)wcRoman8[byData]); else textUpdate.append((char)wcEcma94[byData]); @@ -358,7 +358,7 @@ public class PrinterSimulator { * Get the current printer head position to know the paper length. * @return The current printer head position in pixel from the start of the paper in the bitmap. */ - public int getPaperHeight() { + int getPaperHeight() { return m_nCurRow + 1; } @@ -370,7 +370,7 @@ public class PrinterSimulator { return "HP-82240" + (m_bPrinter82240A ? "A" : "B") + " Printer"; } - private int MAXPRTLINES = 500; //32768; // maximum printable lines (out of paper) + private int MAXPRTLINES; // maximum printable lines (out of paper) private final int LINE_WIDTH = 166; private final int LINE_HEIGHT = 8; private boolean outOfPaper = false; @@ -392,9 +392,6 @@ public class PrinterSimulator { } // bitmap is monochrome so only modify 1 bit -// int nPos = m_nCurRow * m_nBytesPerLine + m_nCurCol / 8; -// int nMask = 0x80 >> (m_nCurCol % 8); - for (int i = 0; i < 8; ++i) // draw each bit { if ((byData & 0x1) == 0x1) // bit set? @@ -402,12 +399,10 @@ public class PrinterSimulator { //m_pbyPrt[nPos] |= nMask; // set bit in bitmap mBitmap.setPixel(m_nCurCol, m_nCurRow + i, 0x00000000); } -// nPos += m_nBytesPerLine; // next line byData >>= 1; // next data bit } ++m_nCurCol; - return; } private void SetSeparatorColumn() @@ -421,7 +416,6 @@ public class PrinterSimulator { { SetColumn(byData); // set empty column } - return; } private void addGraphData(int byData, boolean bGraphicData) { @@ -466,7 +460,7 @@ public class PrinterSimulator { } else // HP82240B Roman 8 or ECMA 94 character set { - sChar = m_bEcma94 == false + sChar = !m_bEcma94 ? sFontRoman8_B[byData] : sFontEcma94_B[byData]; } @@ -506,693 +500,693 @@ public class PrinterSimulator { /** * HP82240A ROMAN8 font table. */ - private static final int sFontRoman8_A[][] = - { - { 0x00, 0x00, 0x00, 0x00, 0x00 }, // 32 - { 0x00, 0x00, 0x5F, 0x00, 0x00 }, // 33 - { 0x00, 0x07, 0x00, 0x07, 0x00 }, // 34 - { 0x14, 0x7F, 0x14, 0x7F, 0x14 }, // 35 - { 0x24, 0x2A, 0x7F, 0x2A, 0x12 }, // 36 - { 0x23, 0x13, 0x08, 0x64, 0x62 }, // 37 - { 0x36, 0x49, 0x56, 0x20, 0x50 }, // 38 - { 0x00, 0x00, 0x07, 0x00, 0x00 }, // 39 - { 0x00, 0x1C, 0x22, 0x41, 0x00 }, // 40 - { 0x00, 0x41, 0x22, 0x1C, 0x00 }, // 41 - { 0x08, 0x2A, 0x1C, 0x2A, 0x08 }, // 42 - { 0x08, 0x08, 0x3E, 0x08, 0x08 }, // 43 - { 0x00, 0xB0, 0x70, 0x00, 0x00 }, // 44 - { 0x08, 0x08, 0x08, 0x08, 0x08 }, // 45 - { 0x00, 0x60, 0x60, 0x00, 0x00 }, // 46 - { 0x20, 0x10, 0x08, 0x04, 0x02 }, // 47 - { 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 48 - { 0x00, 0x42, 0x7F, 0x40, 0x00 }, // 49 - { 0x62, 0x51, 0x49, 0x49, 0x46 }, // 50 - { 0x22, 0x41, 0x49, 0x49, 0x36 }, // 51 - { 0x18, 0x14, 0x12, 0x7F, 0x10 }, // 52 - { 0x27, 0x45, 0x45, 0x45, 0x39 }, // 53 - { 0x3C, 0x4A, 0x49, 0x49, 0x30 }, // 54 - { 0x01, 0x71, 0x09, 0x05, 0x03 }, // 55 - { 0x36, 0x49, 0x49, 0x49, 0x36 }, // 56 - { 0x06, 0x49, 0x49, 0x29, 0x1E }, // 57 - { 0x00, 0x36, 0x36, 0x00, 0x00 }, // 58 - { 0x00, 0xB6, 0x76, 0x00, 0x00 }, // 59 - { 0x08, 0x14, 0x22, 0x41, 0x00 }, // 60 - { 0x14, 0x14, 0x14, 0x14, 0x14 }, // 61 - { 0x41, 0x22, 0x14, 0x08, 0x00 }, // 62 - { 0x02, 0x01, 0x51, 0x09, 0x06 }, // 63 - { 0x3E, 0x41, 0x5D, 0x49, 0x4E }, // 64 - { 0x7E, 0x09, 0x09, 0x09, 0x7E }, // 65 - { 0x7F, 0x49, 0x49, 0x49, 0x36 }, // 66 - { 0x3E, 0x41, 0x41, 0x41, 0x22 }, // 67 - { 0x7F, 0x41, 0x41, 0x22, 0x1C }, // 68 - { 0x7F, 0x49, 0x49, 0x49, 0x41 }, // 69 - { 0x7F, 0x09, 0x09, 0x09, 0x01 }, // 70 - { 0x3E, 0x41, 0x41, 0x51, 0x72 }, // 71 - { 0x7F, 0x08, 0x08, 0x08, 0x7F }, // 72 - { 0x00, 0x41, 0x7F, 0x41, 0x00 }, // 73 - { 0x20, 0x40, 0x40, 0x40, 0x3F }, // 74 - { 0x7F, 0x08, 0x14, 0x22, 0x41 }, // 75 - { 0x7F, 0x40, 0x40, 0x40, 0x40 }, // 76 - { 0x7F, 0x02, 0x0C, 0x02, 0x7F }, // 77 - { 0x7F, 0x04, 0x08, 0x10, 0x7F }, // 78 - { 0x3E, 0x41, 0x41, 0x41, 0x3E }, // 79 - { 0x7F, 0x09, 0x09, 0x09, 0x06 }, // 80 - { 0x3E, 0x41, 0x51, 0x21, 0x5E }, // 81 - { 0x7F, 0x09, 0x19, 0x29, 0x46 }, // 82 - { 0x26, 0x49, 0x49, 0x49, 0x32 }, // 83 - { 0x01, 0x01, 0x7F, 0x01, 0x01 }, // 84 - { 0x3F, 0x40, 0x40, 0x40, 0x3F }, // 85 - { 0x07, 0x18, 0x60, 0x18, 0x07 }, // 86 - { 0x7F, 0x20, 0x18, 0x20, 0x7F }, // 87 - { 0x63, 0x14, 0x08, 0x14, 0x63 }, // 88 - { 0x03, 0x04, 0x78, 0x04, 0x03 }, // 89 - { 0x61, 0x51, 0x49, 0x45, 0x43 }, // 90 - { 0x00, 0x7F, 0x41, 0x41, 0x00 }, // 91 - { 0x02, 0x04, 0x08, 0x10, 0x20 }, // 92 - { 0x00, 0x41, 0x41, 0x7F, 0x00 }, // 93 - { 0x04, 0x02, 0x01, 0x02, 0x04 }, // 94 - { 0x80, 0x80, 0x80, 0x80, 0x80 }, // 95 - { 0x00, 0x03, 0x04, 0x00, 0x00 }, // 96 - { 0x20, 0x54, 0x54, 0x54, 0x78 }, // 97 - { 0x7F, 0x44, 0x44, 0x44, 0x38 }, // 98 - { 0x38, 0x44, 0x44, 0x44, 0x44 }, // 99 - { 0x38, 0x44, 0x44, 0x44, 0x7F }, // 100 - { 0x38, 0x54, 0x54, 0x54, 0x18 }, // 101 - { 0x08, 0x7E, 0x09, 0x02, 0x00 }, // 102 - { 0x18, 0xA4, 0xA4, 0xA4, 0x78 }, // 103 - { 0x7F, 0x04, 0x04, 0x04, 0x78 }, // 104 - { 0x00, 0x44, 0x7D, 0x40, 0x00 }, // 105 - { 0x40, 0x80, 0x84, 0x7D, 0x00 }, // 106 - { 0x7F, 0x10, 0x28, 0x44, 0x00 }, // 107 - { 0x00, 0x41, 0x7F, 0x40, 0x00 }, // 108 - { 0x7C, 0x04, 0x18, 0x04, 0x78 }, // 109 - { 0x7C, 0x04, 0x04, 0x04, 0x78 }, // 110 - { 0x38, 0x44, 0x44, 0x44, 0x38 }, // 111 - { 0xFC, 0x24, 0x24, 0x24, 0x18 }, // 112 - { 0x18, 0x24, 0x24, 0x24, 0xFC }, // 113 - { 0x7C, 0x08, 0x04, 0x04, 0x04 }, // 114 - { 0x48, 0x54, 0x54, 0x54, 0x24 }, // 115 - { 0x04, 0x3F, 0x44, 0x20, 0x00 }, // 116 - { 0x3C, 0x40, 0x40, 0x40, 0x7C }, // 117 - { 0x1C, 0x20, 0x40, 0x20, 0x1C }, // 118 - { 0x3C, 0x40, 0x30, 0x40, 0x3C }, // 119 - { 0x44, 0x28, 0x10, 0x28, 0x44 }, // 120 - { 0x1C, 0xA0, 0xA0, 0xA0, 0x7C }, // 121 - { 0x44, 0x64, 0x54, 0x4C, 0x44 }, // 122 - { 0x08, 0x36, 0x41, 0x41, 0x00 }, // 123 - { 0x00, 0x00, 0x7F, 0x00, 0x00 }, // 124 - { 0x00, 0x41, 0x41, 0x36, 0x08 }, // 125 - { 0x08, 0x04, 0x08, 0x10, 0x08 }, // 126 - { 0x55, 0x2A, 0x55, 0x2A, 0x55 }, // 127 - { 0x00, 0x00, 0x00, 0x00, 0x00 }, // 128 - { 0x08, 0x08, 0x2A, 0x08, 0x08 }, // 129 - { 0x22, 0x14, 0x08, 0x14, 0x22 }, // 130 - { 0x10, 0x20, 0x7F, 0x01, 0x01 }, // 131 - { 0x20, 0x40, 0x3E, 0x01, 0x02 }, // 132 - { 0x41, 0x63, 0x55, 0x49, 0x63 }, // 133 - { 0x7F, 0x7F, 0x3E, 0x1C, 0x08 }, // 134 - { 0x04, 0x7C, 0x04, 0x7C, 0x04 }, // 135 - { 0x30, 0x48, 0x49, 0x52, 0x3C }, // 136 - { 0x50, 0x58, 0x54, 0x52, 0x51 }, // 137 - { 0x51, 0x52, 0x54, 0x58, 0x50 }, // 138 - { 0x14, 0x34, 0x1C, 0x16, 0x14 }, // 139 - { 0x30, 0x48, 0x48, 0x30, 0x48 }, // 140 - { 0x08, 0x08, 0x2A, 0x1C, 0x08 }, // 141 - { 0x08, 0x1C, 0x2A, 0x08, 0x08 }, // 142 - { 0x80, 0x78, 0x40, 0x40, 0x38 }, // 143 - { 0x0F, 0x08, 0x00, 0x78, 0x28 }, // 144 - { 0x00, 0x07, 0x05, 0x07, 0x00 }, // 145 - { 0x08, 0x14, 0x2A, 0x14, 0x22 }, // 146 - { 0x22, 0x14, 0x2A, 0x14, 0x08 }, // 147 - { 0x7F, 0x08, 0x08, 0x08, 0x08 }, // 148 - { 0x00, 0x00, 0xF8, 0x00, 0x00 }, // 149 - { 0x00, 0xE8, 0xA8, 0xB8, 0x00 }, // 150 - { 0x00, 0x1D, 0x15, 0x17, 0x00 }, // 151 - { 0x00, 0x15, 0x15, 0x1F, 0x00 }, // 152 - { 0x00, 0x00, 0x68, 0x80, 0x00 }, // 153 - { 0x00, 0x80, 0x80, 0x74, 0x00 }, // 154 - { 0x60, 0x60, 0x00, 0x60, 0x60 }, // 155 - { 0x00, 0x00, 0x0D, 0x10, 0x00 }, // 156 - { 0x00, 0x10, 0x10, 0x0D, 0x00 }, // 157 - { 0x00, 0x1F, 0x04, 0x0A, 0x10 }, // 158 - { 0x00, 0x1E, 0x02, 0x02, 0x1C }, // 159 - { 0x60, 0x50, 0x58, 0x64, 0x42 }, // 160 - { 0x78, 0x14, 0x15, 0x16, 0x78 }, // 161 - { 0x78, 0x16, 0x15, 0x16, 0x78 }, // 162 - { 0x7C, 0x54, 0x55, 0x56, 0x44 }, // 163 - { 0x7C, 0x56, 0x55, 0x56, 0x44 }, // 164 - { 0x7C, 0x55, 0x54, 0x55, 0x44 }, // 165 - { 0x00, 0x46, 0x7D, 0x46, 0x00 }, // 166 - { 0x00, 0x45, 0x7C, 0x45, 0x00 }, // 167 - { 0x00, 0x00, 0x02, 0x01, 0x00 }, // 168 - { 0x00, 0x01, 0x02, 0x00, 0x00 }, // 169 - { 0x00, 0x02, 0x01, 0x02, 0x00 }, // 170 - { 0x00, 0x01, 0x00, 0x01, 0x00 }, // 171 - { 0x02, 0x01, 0x02, 0x04, 0x02 }, // 172 - { 0x3C, 0x41, 0x42, 0x40, 0x3C }, // 173 - { 0x38, 0x42, 0x41, 0x42, 0x38 }, // 174 - { 0x58, 0x7E, 0x59, 0x41, 0x02 }, // 175 - { 0x01, 0x01, 0x01, 0x01, 0x01 }, // 176 - { 0x0C, 0x10, 0x62, 0x11, 0x0C }, // 177 - { 0x18, 0xA0, 0xA2, 0xA1, 0x78 }, // 178 - { 0x00, 0x07, 0x05, 0x07, 0x00 }, // 179 - { 0x1E, 0xA1, 0xA1, 0x61, 0x12 }, // 180 - { 0x18, 0xA4, 0xA4, 0x64, 0x24 }, // 181 - { 0x7E, 0x09, 0x12, 0x21, 0x7C }, // 182 - { 0x7A, 0x09, 0x0A, 0x09, 0x70 }, // 183 - { 0x00, 0x00, 0x7D, 0x00, 0x00 }, // 184 - { 0x30, 0x48, 0x45, 0x40, 0x20 }, // 185 - { 0x5D, 0x22, 0x22, 0x22, 0x5D }, // 186 - { 0x48, 0x7E, 0x49, 0x41, 0x02 }, // 187 - { 0x2B, 0x2C, 0x78, 0x2C, 0x2B }, // 188 - { 0x08, 0x56, 0x55, 0x35, 0x08 }, // 189 - { 0x40, 0x48, 0x3E, 0x09, 0x01 }, // 190 - { 0x18, 0x24, 0x7E, 0x24, 0x24 }, // 191 - { 0x20, 0x56, 0x55, 0x56, 0x78 }, // 192 - { 0x38, 0x56, 0x55, 0x56, 0x48 }, // 193 - { 0x30, 0x4A, 0x49, 0x4A, 0x30 }, // 194 - { 0x30, 0x42, 0x41, 0x42, 0x30 }, // 195 - { 0x20, 0x54, 0x56, 0x55, 0x78 }, // 196 - { 0x38, 0x54, 0x56, 0x55, 0x48 }, // 197 - { 0x30, 0x48, 0x4A, 0x49, 0x30 }, // 198 - { 0x38, 0x40, 0x42, 0x41, 0x38 }, // 199 - { 0x20, 0x55, 0x56, 0x54, 0x78 }, // 200 - { 0x38, 0x55, 0x56, 0x54, 0x48 }, // 201 - { 0x30, 0x49, 0x4A, 0x48, 0x30 }, // 202 - { 0x38, 0x41, 0x42, 0x40, 0x38 }, // 203 - { 0x20, 0x55, 0x54, 0x55, 0x78 }, // 204 - { 0x38, 0x55, 0x54, 0x55, 0x48 }, // 205 - { 0x30, 0x49, 0x48, 0x49, 0x30 }, // 206 - { 0x38, 0x41, 0x40, 0x41, 0x38 }, // 207 - { 0x78, 0x17, 0x15, 0x17, 0x78 }, // 208 - { 0x00, 0x4A, 0x79, 0x42, 0x00 }, // 209 - { 0x5C, 0x32, 0x2A, 0x26, 0x1D }, // 210 - { 0x7E, 0x09, 0x7E, 0x49, 0x49 }, // 211 - { 0x20, 0x57, 0x55, 0x57, 0x78 }, // 212 - { 0x00, 0x48, 0x7A, 0x41, 0x00 }, // 213 - { 0x48, 0x34, 0x1C, 0x16, 0x09 }, // 214 - { 0x24, 0x54, 0x38, 0x54, 0x48 }, // 215 - { 0x78, 0x15, 0x14, 0x15, 0x78 }, // 216 - { 0x00, 0x49, 0x7A, 0x40, 0x00 }, // 217 - { 0x3C, 0x43, 0x42, 0x43, 0x3C }, // 218 - { 0x3C, 0x41, 0x40, 0x41, 0x3C }, // 219 - { 0x7C, 0x54, 0x56, 0x55, 0x44 }, // 220 - { 0x00, 0x49, 0x78, 0x41, 0x00 }, // 221 - { 0xFE, 0x25, 0x25, 0x25, 0x1A }, // 222 - { 0x38, 0x46, 0x45, 0x46, 0x38 }, // 223 - { 0x78, 0x14, 0x16, 0x15, 0x78 }, // 224 - { 0x7A, 0x15, 0x16, 0x15, 0x78 }, // 225 - { 0x22, 0x55, 0x56, 0x55, 0x78 }, // 226 - { 0x08, 0x7F, 0x49, 0x22, 0x1C }, // 227 - { 0x30, 0x48, 0x4A, 0x3F, 0x02 }, // 228 - { 0x00, 0x44, 0x7E, 0x45, 0x00 }, // 229 - { 0x00, 0x45, 0x7E, 0x44, 0x00 }, // 230 - { 0x38, 0x44, 0x46, 0x45, 0x38 }, // 231 - { 0x38, 0x45, 0x46, 0x44, 0x38 }, // 232 - { 0x3A, 0x45, 0x46, 0x45, 0x38 }, // 233 - { 0x30, 0x4A, 0x49, 0x4A, 0x31 }, // 234 - { 0x48, 0x55, 0x56, 0x55, 0x24 }, // 235 - { 0x40, 0x51, 0x2A, 0x09, 0x00 }, // 236 - { 0x3C, 0x40, 0x42, 0x41, 0x3C }, // 237 - { 0x0C, 0x11, 0x60, 0x11, 0x0C }, // 238 - { 0x1C, 0xA1, 0xA0, 0xA1, 0x7C }, // 239 - { 0x41, 0x7F, 0x4B, 0x0A, 0x04 }, // 240 - { 0x7F, 0x22, 0x22, 0x22, 0x1C }, // 241 - { 0x00, 0x00, 0x0C, 0x0C, 0x00 }, // 242 - { 0x80, 0x78, 0x40, 0x40, 0x38 }, // 243 - { 0x06, 0x0F, 0x7F, 0x01, 0x7F }, // 244 - { 0x15, 0x1F, 0x38, 0x24, 0x72 }, // 245 - { 0x04, 0x04, 0x04, 0x04, 0x04 }, // 246 - { 0x17, 0x08, 0x34, 0x22, 0x70 }, // 247 - { 0x17, 0x08, 0x04, 0x6A, 0x58 }, // 248 - { 0x00, 0x25, 0x2B, 0x2E, 0x20 }, // 249 - { 0x26, 0x29, 0x29, 0x29, 0x26 }, // 250 - { 0x08, 0x14, 0x2A, 0x14, 0x22 }, // 251 - { 0x7F, 0x7F, 0x7F, 0x7F, 0x7F }, // 252 - { 0x22, 0x14, 0x2A, 0x14, 0x08 }, // 253 - { 0x00, 0x24, 0x2E, 0x24, 0x00 }, // 254 - { 0x00, 0x00, 0x00, 0x00, 0x00 } // 255 - }; + private static final int[][] sFontRoman8_A = + { + {0x00, 0x00, 0x00, 0x00, 0x00}, // 32 + {0x00, 0x00, 0x5F, 0x00, 0x00}, // 33 + {0x00, 0x07, 0x00, 0x07, 0x00}, // 34 + {0x14, 0x7F, 0x14, 0x7F, 0x14}, // 35 + {0x24, 0x2A, 0x7F, 0x2A, 0x12}, // 36 + {0x23, 0x13, 0x08, 0x64, 0x62}, // 37 + {0x36, 0x49, 0x56, 0x20, 0x50}, // 38 + {0x00, 0x00, 0x07, 0x00, 0x00}, // 39 + {0x00, 0x1C, 0x22, 0x41, 0x00}, // 40 + {0x00, 0x41, 0x22, 0x1C, 0x00}, // 41 + {0x08, 0x2A, 0x1C, 0x2A, 0x08}, // 42 + {0x08, 0x08, 0x3E, 0x08, 0x08}, // 43 + {0x00, 0xB0, 0x70, 0x00, 0x00}, // 44 + {0x08, 0x08, 0x08, 0x08, 0x08}, // 45 + {0x00, 0x60, 0x60, 0x00, 0x00}, // 46 + {0x20, 0x10, 0x08, 0x04, 0x02}, // 47 + {0x3E, 0x51, 0x49, 0x45, 0x3E}, // 48 + {0x00, 0x42, 0x7F, 0x40, 0x00}, // 49 + {0x62, 0x51, 0x49, 0x49, 0x46}, // 50 + {0x22, 0x41, 0x49, 0x49, 0x36}, // 51 + {0x18, 0x14, 0x12, 0x7F, 0x10}, // 52 + {0x27, 0x45, 0x45, 0x45, 0x39}, // 53 + {0x3C, 0x4A, 0x49, 0x49, 0x30}, // 54 + {0x01, 0x71, 0x09, 0x05, 0x03}, // 55 + {0x36, 0x49, 0x49, 0x49, 0x36}, // 56 + {0x06, 0x49, 0x49, 0x29, 0x1E}, // 57 + {0x00, 0x36, 0x36, 0x00, 0x00}, // 58 + {0x00, 0xB6, 0x76, 0x00, 0x00}, // 59 + {0x08, 0x14, 0x22, 0x41, 0x00}, // 60 + {0x14, 0x14, 0x14, 0x14, 0x14}, // 61 + {0x41, 0x22, 0x14, 0x08, 0x00}, // 62 + {0x02, 0x01, 0x51, 0x09, 0x06}, // 63 + {0x3E, 0x41, 0x5D, 0x49, 0x4E}, // 64 + {0x7E, 0x09, 0x09, 0x09, 0x7E}, // 65 + {0x7F, 0x49, 0x49, 0x49, 0x36}, // 66 + {0x3E, 0x41, 0x41, 0x41, 0x22}, // 67 + {0x7F, 0x41, 0x41, 0x22, 0x1C}, // 68 + {0x7F, 0x49, 0x49, 0x49, 0x41}, // 69 + {0x7F, 0x09, 0x09, 0x09, 0x01}, // 70 + {0x3E, 0x41, 0x41, 0x51, 0x72}, // 71 + {0x7F, 0x08, 0x08, 0x08, 0x7F}, // 72 + {0x00, 0x41, 0x7F, 0x41, 0x00}, // 73 + {0x20, 0x40, 0x40, 0x40, 0x3F}, // 74 + {0x7F, 0x08, 0x14, 0x22, 0x41}, // 75 + {0x7F, 0x40, 0x40, 0x40, 0x40}, // 76 + {0x7F, 0x02, 0x0C, 0x02, 0x7F}, // 77 + {0x7F, 0x04, 0x08, 0x10, 0x7F}, // 78 + {0x3E, 0x41, 0x41, 0x41, 0x3E}, // 79 + {0x7F, 0x09, 0x09, 0x09, 0x06}, // 80 + {0x3E, 0x41, 0x51, 0x21, 0x5E}, // 81 + {0x7F, 0x09, 0x19, 0x29, 0x46}, // 82 + {0x26, 0x49, 0x49, 0x49, 0x32}, // 83 + {0x01, 0x01, 0x7F, 0x01, 0x01}, // 84 + {0x3F, 0x40, 0x40, 0x40, 0x3F}, // 85 + {0x07, 0x18, 0x60, 0x18, 0x07}, // 86 + {0x7F, 0x20, 0x18, 0x20, 0x7F}, // 87 + {0x63, 0x14, 0x08, 0x14, 0x63}, // 88 + {0x03, 0x04, 0x78, 0x04, 0x03}, // 89 + {0x61, 0x51, 0x49, 0x45, 0x43}, // 90 + {0x00, 0x7F, 0x41, 0x41, 0x00}, // 91 + {0x02, 0x04, 0x08, 0x10, 0x20}, // 92 + {0x00, 0x41, 0x41, 0x7F, 0x00}, // 93 + {0x04, 0x02, 0x01, 0x02, 0x04}, // 94 + {0x80, 0x80, 0x80, 0x80, 0x80}, // 95 + {0x00, 0x03, 0x04, 0x00, 0x00}, // 96 + {0x20, 0x54, 0x54, 0x54, 0x78}, // 97 + {0x7F, 0x44, 0x44, 0x44, 0x38}, // 98 + {0x38, 0x44, 0x44, 0x44, 0x44}, // 99 + {0x38, 0x44, 0x44, 0x44, 0x7F}, // 100 + {0x38, 0x54, 0x54, 0x54, 0x18}, // 101 + {0x08, 0x7E, 0x09, 0x02, 0x00}, // 102 + {0x18, 0xA4, 0xA4, 0xA4, 0x78}, // 103 + {0x7F, 0x04, 0x04, 0x04, 0x78}, // 104 + {0x00, 0x44, 0x7D, 0x40, 0x00}, // 105 + {0x40, 0x80, 0x84, 0x7D, 0x00}, // 106 + {0x7F, 0x10, 0x28, 0x44, 0x00}, // 107 + {0x00, 0x41, 0x7F, 0x40, 0x00}, // 108 + {0x7C, 0x04, 0x18, 0x04, 0x78}, // 109 + {0x7C, 0x04, 0x04, 0x04, 0x78}, // 110 + {0x38, 0x44, 0x44, 0x44, 0x38}, // 111 + {0xFC, 0x24, 0x24, 0x24, 0x18}, // 112 + {0x18, 0x24, 0x24, 0x24, 0xFC}, // 113 + {0x7C, 0x08, 0x04, 0x04, 0x04}, // 114 + {0x48, 0x54, 0x54, 0x54, 0x24}, // 115 + {0x04, 0x3F, 0x44, 0x20, 0x00}, // 116 + {0x3C, 0x40, 0x40, 0x40, 0x7C}, // 117 + {0x1C, 0x20, 0x40, 0x20, 0x1C}, // 118 + {0x3C, 0x40, 0x30, 0x40, 0x3C}, // 119 + {0x44, 0x28, 0x10, 0x28, 0x44}, // 120 + {0x1C, 0xA0, 0xA0, 0xA0, 0x7C}, // 121 + {0x44, 0x64, 0x54, 0x4C, 0x44}, // 122 + {0x08, 0x36, 0x41, 0x41, 0x00}, // 123 + {0x00, 0x00, 0x7F, 0x00, 0x00}, // 124 + {0x00, 0x41, 0x41, 0x36, 0x08}, // 125 + {0x08, 0x04, 0x08, 0x10, 0x08}, // 126 + {0x55, 0x2A, 0x55, 0x2A, 0x55}, // 127 + {0x00, 0x00, 0x00, 0x00, 0x00}, // 128 + {0x08, 0x08, 0x2A, 0x08, 0x08}, // 129 + {0x22, 0x14, 0x08, 0x14, 0x22}, // 130 + {0x10, 0x20, 0x7F, 0x01, 0x01}, // 131 + {0x20, 0x40, 0x3E, 0x01, 0x02}, // 132 + {0x41, 0x63, 0x55, 0x49, 0x63}, // 133 + {0x7F, 0x7F, 0x3E, 0x1C, 0x08}, // 134 + {0x04, 0x7C, 0x04, 0x7C, 0x04}, // 135 + {0x30, 0x48, 0x49, 0x52, 0x3C}, // 136 + {0x50, 0x58, 0x54, 0x52, 0x51}, // 137 + {0x51, 0x52, 0x54, 0x58, 0x50}, // 138 + {0x14, 0x34, 0x1C, 0x16, 0x14}, // 139 + {0x30, 0x48, 0x48, 0x30, 0x48}, // 140 + {0x08, 0x08, 0x2A, 0x1C, 0x08}, // 141 + {0x08, 0x1C, 0x2A, 0x08, 0x08}, // 142 + {0x80, 0x78, 0x40, 0x40, 0x38}, // 143 + {0x0F, 0x08, 0x00, 0x78, 0x28}, // 144 + {0x00, 0x07, 0x05, 0x07, 0x00}, // 145 + {0x08, 0x14, 0x2A, 0x14, 0x22}, // 146 + {0x22, 0x14, 0x2A, 0x14, 0x08}, // 147 + {0x7F, 0x08, 0x08, 0x08, 0x08}, // 148 + {0x00, 0x00, 0xF8, 0x00, 0x00}, // 149 + {0x00, 0xE8, 0xA8, 0xB8, 0x00}, // 150 + {0x00, 0x1D, 0x15, 0x17, 0x00}, // 151 + {0x00, 0x15, 0x15, 0x1F, 0x00}, // 152 + {0x00, 0x00, 0x68, 0x80, 0x00}, // 153 + {0x00, 0x80, 0x80, 0x74, 0x00}, // 154 + {0x60, 0x60, 0x00, 0x60, 0x60}, // 155 + {0x00, 0x00, 0x0D, 0x10, 0x00}, // 156 + {0x00, 0x10, 0x10, 0x0D, 0x00}, // 157 + {0x00, 0x1F, 0x04, 0x0A, 0x10}, // 158 + {0x00, 0x1E, 0x02, 0x02, 0x1C}, // 159 + {0x60, 0x50, 0x58, 0x64, 0x42}, // 160 + {0x78, 0x14, 0x15, 0x16, 0x78}, // 161 + {0x78, 0x16, 0x15, 0x16, 0x78}, // 162 + {0x7C, 0x54, 0x55, 0x56, 0x44}, // 163 + {0x7C, 0x56, 0x55, 0x56, 0x44}, // 164 + {0x7C, 0x55, 0x54, 0x55, 0x44}, // 165 + {0x00, 0x46, 0x7D, 0x46, 0x00}, // 166 + {0x00, 0x45, 0x7C, 0x45, 0x00}, // 167 + {0x00, 0x00, 0x02, 0x01, 0x00}, // 168 + {0x00, 0x01, 0x02, 0x00, 0x00}, // 169 + {0x00, 0x02, 0x01, 0x02, 0x00}, // 170 + {0x00, 0x01, 0x00, 0x01, 0x00}, // 171 + {0x02, 0x01, 0x02, 0x04, 0x02}, // 172 + {0x3C, 0x41, 0x42, 0x40, 0x3C}, // 173 + {0x38, 0x42, 0x41, 0x42, 0x38}, // 174 + {0x58, 0x7E, 0x59, 0x41, 0x02}, // 175 + {0x01, 0x01, 0x01, 0x01, 0x01}, // 176 + {0x0C, 0x10, 0x62, 0x11, 0x0C}, // 177 + {0x18, 0xA0, 0xA2, 0xA1, 0x78}, // 178 + {0x00, 0x07, 0x05, 0x07, 0x00}, // 179 + {0x1E, 0xA1, 0xA1, 0x61, 0x12}, // 180 + {0x18, 0xA4, 0xA4, 0x64, 0x24}, // 181 + {0x7E, 0x09, 0x12, 0x21, 0x7C}, // 182 + {0x7A, 0x09, 0x0A, 0x09, 0x70}, // 183 + {0x00, 0x00, 0x7D, 0x00, 0x00}, // 184 + {0x30, 0x48, 0x45, 0x40, 0x20}, // 185 + {0x5D, 0x22, 0x22, 0x22, 0x5D}, // 186 + {0x48, 0x7E, 0x49, 0x41, 0x02}, // 187 + {0x2B, 0x2C, 0x78, 0x2C, 0x2B}, // 188 + {0x08, 0x56, 0x55, 0x35, 0x08}, // 189 + {0x40, 0x48, 0x3E, 0x09, 0x01}, // 190 + {0x18, 0x24, 0x7E, 0x24, 0x24}, // 191 + {0x20, 0x56, 0x55, 0x56, 0x78}, // 192 + {0x38, 0x56, 0x55, 0x56, 0x48}, // 193 + {0x30, 0x4A, 0x49, 0x4A, 0x30}, // 194 + {0x30, 0x42, 0x41, 0x42, 0x30}, // 195 + {0x20, 0x54, 0x56, 0x55, 0x78}, // 196 + {0x38, 0x54, 0x56, 0x55, 0x48}, // 197 + {0x30, 0x48, 0x4A, 0x49, 0x30}, // 198 + {0x38, 0x40, 0x42, 0x41, 0x38}, // 199 + {0x20, 0x55, 0x56, 0x54, 0x78}, // 200 + {0x38, 0x55, 0x56, 0x54, 0x48}, // 201 + {0x30, 0x49, 0x4A, 0x48, 0x30}, // 202 + {0x38, 0x41, 0x42, 0x40, 0x38}, // 203 + {0x20, 0x55, 0x54, 0x55, 0x78}, // 204 + {0x38, 0x55, 0x54, 0x55, 0x48}, // 205 + {0x30, 0x49, 0x48, 0x49, 0x30}, // 206 + {0x38, 0x41, 0x40, 0x41, 0x38}, // 207 + {0x78, 0x17, 0x15, 0x17, 0x78}, // 208 + {0x00, 0x4A, 0x79, 0x42, 0x00}, // 209 + {0x5C, 0x32, 0x2A, 0x26, 0x1D}, // 210 + {0x7E, 0x09, 0x7E, 0x49, 0x49}, // 211 + {0x20, 0x57, 0x55, 0x57, 0x78}, // 212 + {0x00, 0x48, 0x7A, 0x41, 0x00}, // 213 + {0x48, 0x34, 0x1C, 0x16, 0x09}, // 214 + {0x24, 0x54, 0x38, 0x54, 0x48}, // 215 + {0x78, 0x15, 0x14, 0x15, 0x78}, // 216 + {0x00, 0x49, 0x7A, 0x40, 0x00}, // 217 + {0x3C, 0x43, 0x42, 0x43, 0x3C}, // 218 + {0x3C, 0x41, 0x40, 0x41, 0x3C}, // 219 + {0x7C, 0x54, 0x56, 0x55, 0x44}, // 220 + {0x00, 0x49, 0x78, 0x41, 0x00}, // 221 + {0xFE, 0x25, 0x25, 0x25, 0x1A}, // 222 + {0x38, 0x46, 0x45, 0x46, 0x38}, // 223 + {0x78, 0x14, 0x16, 0x15, 0x78}, // 224 + {0x7A, 0x15, 0x16, 0x15, 0x78}, // 225 + {0x22, 0x55, 0x56, 0x55, 0x78}, // 226 + {0x08, 0x7F, 0x49, 0x22, 0x1C}, // 227 + {0x30, 0x48, 0x4A, 0x3F, 0x02}, // 228 + {0x00, 0x44, 0x7E, 0x45, 0x00}, // 229 + {0x00, 0x45, 0x7E, 0x44, 0x00}, // 230 + {0x38, 0x44, 0x46, 0x45, 0x38}, // 231 + {0x38, 0x45, 0x46, 0x44, 0x38}, // 232 + {0x3A, 0x45, 0x46, 0x45, 0x38}, // 233 + {0x30, 0x4A, 0x49, 0x4A, 0x31}, // 234 + {0x48, 0x55, 0x56, 0x55, 0x24}, // 235 + {0x40, 0x51, 0x2A, 0x09, 0x00}, // 236 + {0x3C, 0x40, 0x42, 0x41, 0x3C}, // 237 + {0x0C, 0x11, 0x60, 0x11, 0x0C}, // 238 + {0x1C, 0xA1, 0xA0, 0xA1, 0x7C}, // 239 + {0x41, 0x7F, 0x4B, 0x0A, 0x04}, // 240 + {0x7F, 0x22, 0x22, 0x22, 0x1C}, // 241 + {0x00, 0x00, 0x0C, 0x0C, 0x00}, // 242 + {0x80, 0x78, 0x40, 0x40, 0x38}, // 243 + {0x06, 0x0F, 0x7F, 0x01, 0x7F}, // 244 + {0x15, 0x1F, 0x38, 0x24, 0x72}, // 245 + {0x04, 0x04, 0x04, 0x04, 0x04}, // 246 + {0x17, 0x08, 0x34, 0x22, 0x70}, // 247 + {0x17, 0x08, 0x04, 0x6A, 0x58}, // 248 + {0x00, 0x25, 0x2B, 0x2E, 0x20}, // 249 + {0x26, 0x29, 0x29, 0x29, 0x26}, // 250 + {0x08, 0x14, 0x2A, 0x14, 0x22}, // 251 + {0x7F, 0x7F, 0x7F, 0x7F, 0x7F}, // 252 + {0x22, 0x14, 0x2A, 0x14, 0x08}, // 253 + {0x00, 0x24, 0x2E, 0x24, 0x00}, // 254 + {0x00, 0x00, 0x00, 0x00, 0x00} // 255 + }; /** * HP82240B ROMAN8 font table. */ - private static final int sFontRoman8_B[][] = - { - { 0x00, 0x00, 0x00, 0x00, 0x00 }, // 32 - { 0x00, 0x00, 0x5F, 0x00, 0x00 }, // 33 - { 0x00, 0x07, 0x00, 0x07, 0x00 }, // 34 - { 0x14, 0x7F, 0x14, 0x7F, 0x14 }, // 35 - { 0x24, 0x2A, 0x7F, 0x2A, 0x12 }, // 36 - { 0x23, 0x13, 0x08, 0x64, 0x62 }, // 37 - { 0x36, 0x49, 0x56, 0x20, 0x50 }, // 38 - { 0x00, 0x00, 0x07, 0x00, 0x00 }, // 39 - { 0x00, 0x1C, 0x22, 0x41, 0x00 }, // 40 - { 0x00, 0x41, 0x22, 0x1C, 0x00 }, // 41 - { 0x08, 0x2A, 0x1C, 0x2A, 0x08 }, // 42 - { 0x08, 0x08, 0x3E, 0x08, 0x08 }, // 43 - { 0x00, 0xB0, 0x70, 0x00, 0x00 }, // 44 - { 0x08, 0x08, 0x08, 0x08, 0x08 }, // 45 - { 0x00, 0x60, 0x60, 0x00, 0x00 }, // 46 - { 0x20, 0x10, 0x08, 0x04, 0x02 }, // 47 - { 0x3C, 0x62, 0x52, 0x4A, 0x3C }, // 48 - { 0x00, 0x44, 0x7E, 0x40, 0x00 }, // 49 - { 0x64, 0x52, 0x4A, 0x4A, 0x44 }, // 50 - { 0x24, 0x42, 0x4A, 0x4A, 0x34 }, // 51 - { 0x10, 0x18, 0x14, 0x7E, 0x10 }, // 52 - { 0x2E, 0x4A, 0x4A, 0x4A, 0x32 }, // 53 - { 0x38, 0x54, 0x52, 0x52, 0x20 }, // 54 - { 0x02, 0x62, 0x12, 0x0A, 0x06 }, // 55 - { 0x34, 0x4A, 0x4A, 0x4A, 0x34 }, // 56 - { 0x04, 0x4A, 0x4A, 0x2A, 0x1C }, // 57 - { 0x00, 0x36, 0x36, 0x00, 0x00 }, // 58 - { 0x00, 0xB6, 0x76, 0x00, 0x00 }, // 59 - { 0x08, 0x14, 0x22, 0x41, 0x00 }, // 60 - { 0x14, 0x14, 0x14, 0x14, 0x14 }, // 61 - { 0x41, 0x22, 0x14, 0x08, 0x00 }, // 62 - { 0x02, 0x01, 0x51, 0x09, 0x06 }, // 63 - { 0x3E, 0x41, 0x5D, 0x49, 0x4E }, // 64 - { 0x7C, 0x12, 0x12, 0x12, 0x7C }, // 65 - { 0x7E, 0x4A, 0x4A, 0x4A, 0x34 }, // 66 - { 0x3C, 0x42, 0x42, 0x42, 0x24 }, // 67 - { 0x7E, 0x42, 0x42, 0x24, 0x18 }, // 68 - { 0x7E, 0x4A, 0x4A, 0x4A, 0x42 }, // 69 - { 0x7E, 0x0A, 0x0A, 0x0A, 0x02 }, // 70 - { 0x3C, 0x42, 0x42, 0x52, 0x74 }, // 71 - { 0x7E, 0x08, 0x08, 0x08, 0x7E }, // 72 - { 0x00, 0x42, 0x7E, 0x42, 0x00 }, // 73 - { 0x20, 0x40, 0x40, 0x40, 0x3E }, // 74 - { 0x7E, 0x08, 0x14, 0x22, 0x40 }, // 75 - { 0x7E, 0x40, 0x40, 0x40, 0x40 }, // 76 - { 0x7E, 0x04, 0x18, 0x04, 0x7E }, // 77 - { 0x7E, 0x04, 0x08, 0x10, 0x7E }, // 78 - { 0x3C, 0x42, 0x42, 0x42, 0x3C }, // 79 - { 0x7E, 0x12, 0x12, 0x12, 0x0C }, // 80 - { 0x3C, 0x42, 0x52, 0x22, 0x5C }, // 81 - { 0x7E, 0x12, 0x12, 0x32, 0x4C }, // 82 - { 0x24, 0x4A, 0x4A, 0x4A, 0x30 }, // 83 - { 0x02, 0x02, 0x7E, 0x02, 0x02 }, // 84 - { 0x3E, 0x40, 0x40, 0x40, 0x3E }, // 85 - { 0x0E, 0x30, 0x40, 0x30, 0x0E }, // 86 - { 0x7E, 0x20, 0x18, 0x20, 0x7E }, // 87 - { 0x42, 0x24, 0x18, 0x24, 0x42 }, // 88 - { 0x06, 0x08, 0x70, 0x08, 0x06 }, // 89 - { 0x62, 0x52, 0x4A, 0x46, 0x42 }, // 90 - { 0x00, 0x7F, 0x41, 0x41, 0x00 }, // 91 - { 0x02, 0x04, 0x08, 0x10, 0x20 }, // 92 - { 0x00, 0x41, 0x41, 0x7F, 0x00 }, // 93 - { 0x04, 0x02, 0x01, 0x02, 0x04 }, // 94 - { 0x80, 0x80, 0x80, 0x80, 0x80 }, // 95 - { 0x00, 0x03, 0x04, 0x00, 0x00 }, // 96 - { 0x20, 0x54, 0x54, 0x54, 0x78 }, // 97 - { 0x7F, 0x44, 0x44, 0x44, 0x38 }, // 98 - { 0x38, 0x44, 0x44, 0x44, 0x44 }, // 99 - { 0x38, 0x44, 0x44, 0x44, 0x7F }, // 100 - { 0x38, 0x54, 0x54, 0x54, 0x18 }, // 101 - { 0x08, 0x7E, 0x09, 0x02, 0x00 }, // 102 - { 0x18, 0xA4, 0xA4, 0xA4, 0x78 }, // 103 - { 0x7F, 0x04, 0x04, 0x04, 0x78 }, // 104 - { 0x00, 0x44, 0x7D, 0x40, 0x00 }, // 105 - { 0x40, 0x80, 0x84, 0x7D, 0x00 }, // 106 - { 0x7F, 0x10, 0x28, 0x44, 0x00 }, // 107 - { 0x00, 0x41, 0x7F, 0x40, 0x00 }, // 108 - { 0x7C, 0x04, 0x38, 0x04, 0x78 }, // 109 - { 0x7C, 0x04, 0x04, 0x04, 0x78 }, // 110 - { 0x38, 0x44, 0x44, 0x44, 0x38 }, // 111 - { 0xFC, 0x24, 0x24, 0x24, 0x18 }, // 112 - { 0x18, 0x24, 0x24, 0x24, 0xFC }, // 113 - { 0x7C, 0x08, 0x04, 0x04, 0x04 }, // 114 - { 0x48, 0x54, 0x54, 0x54, 0x24 }, // 115 - { 0x04, 0x3F, 0x44, 0x20, 0x00 }, // 116 - { 0x3C, 0x40, 0x40, 0x40, 0x7C }, // 117 - { 0x1C, 0x20, 0x40, 0x20, 0x1C }, // 118 - { 0x3C, 0x40, 0x30, 0x40, 0x3C }, // 119 - { 0x44, 0x28, 0x10, 0x28, 0x44 }, // 120 - { 0x1C, 0xA0, 0xA0, 0xA0, 0x7C }, // 121 - { 0x44, 0x64, 0x54, 0x4C, 0x44 }, // 122 - { 0x08, 0x36, 0x41, 0x41, 0x00 }, // 123 - { 0x00, 0x00, 0x7F, 0x00, 0x00 }, // 124 - { 0x00, 0x41, 0x41, 0x36, 0x08 }, // 125 - { 0x08, 0x04, 0x08, 0x10, 0x08 }, // 126 - { 0x55, 0x2A, 0x55, 0x2A, 0x55 }, // 127 - { 0x00, 0x00, 0x00, 0x00, 0x00 }, // 128 - { 0x08, 0x08, 0x2A, 0x08, 0x08 }, // 129 - { 0x22, 0x14, 0x08, 0x14, 0x22 }, // 130 - { 0x10, 0x20, 0x7F, 0x01, 0x01 }, // 131 - { 0x20, 0x40, 0x3E, 0x01, 0x02 }, // 132 - { 0x41, 0x63, 0x55, 0x49, 0x63 }, // 133 - { 0x7F, 0x7F, 0x3E, 0x1C, 0x08 }, // 134 - { 0x04, 0x7C, 0x04, 0x7C, 0x04 }, // 135 - { 0x30, 0x49, 0x4A, 0x4C, 0x38 }, // 136 - { 0x50, 0x58, 0x54, 0x52, 0x51 }, // 137 - { 0x51, 0x52, 0x54, 0x58, 0x50 }, // 138 - { 0x14, 0x34, 0x1C, 0x16, 0x14 }, // 139 - { 0x30, 0x48, 0x48, 0x30, 0x48 }, // 140 - { 0x08, 0x08, 0x2A, 0x1C, 0x08 }, // 141 - { 0x08, 0x1C, 0x2A, 0x08, 0x08 }, // 142 - { 0x7C, 0x20, 0x20, 0x1C, 0x20 }, // 143 - { 0x0F, 0x08, 0x00, 0x78, 0x28 }, // 144 - { 0x00, 0x07, 0x05, 0x07, 0x00 }, // 145 - { 0x08, 0x14, 0x2A, 0x14, 0x22 }, // 146 - { 0x22, 0x14, 0x2A, 0x14, 0x08 }, // 147 - { 0x7F, 0x08, 0x08, 0x08, 0x08 }, // 148 - { 0x00, 0x00, 0xF8, 0x00, 0x00 }, // 149 - { 0x00, 0xE8, 0xA8, 0xB8, 0x00 }, // 150 - { 0x00, 0x1D, 0x15, 0x17, 0x00 }, // 151 - { 0x00, 0x15, 0x15, 0x1F, 0x00 }, // 152 - { 0x00, 0x00, 0x68, 0x80, 0x00 }, // 153 - { 0x00, 0x80, 0x80, 0x74, 0x00 }, // 154 - { 0x60, 0x60, 0x00, 0x60, 0x60 }, // 155 - { 0x00, 0x00, 0x0D, 0x10, 0x00 }, // 156 - { 0x00, 0x10, 0x10, 0x0D, 0x00 }, // 157 - { 0x00, 0x1F, 0x04, 0x0A, 0x10 }, // 158 - { 0x00, 0x1E, 0x02, 0x02, 0x1C }, // 159 - { 0x60, 0x50, 0x58, 0x64, 0x42 }, // 160 - { 0x78, 0x15, 0x16, 0x14, 0x78 }, // 161 - { 0x78, 0x16, 0x15, 0x16, 0x78 }, // 162 - { 0x7C, 0x55, 0x56, 0x54, 0x44 }, // 163 - { 0x7C, 0x56, 0x55, 0x56, 0x44 }, // 164 - { 0x7C, 0x55, 0x54, 0x55, 0x44 }, // 165 - { 0x00, 0x46, 0x7D, 0x46, 0x00 }, // 166 - { 0x00, 0x45, 0x7C, 0x45, 0x00 }, // 167 - { 0x00, 0x00, 0x02, 0x01, 0x00 }, // 168 - { 0x00, 0x01, 0x02, 0x00, 0x00 }, // 169 - { 0x00, 0x02, 0x01, 0x02, 0x00 }, // 170 - { 0x00, 0x01, 0x00, 0x01, 0x00 }, // 171 - { 0x02, 0x01, 0x02, 0x04, 0x02 }, // 172 - { 0x3C, 0x41, 0x42, 0x40, 0x3C }, // 173 - { 0x38, 0x42, 0x41, 0x42, 0x38 }, // 174 - { 0x58, 0x7E, 0x59, 0x41, 0x02 }, // 175 - { 0x01, 0x01, 0x01, 0x01, 0x01 }, // 176 - { 0x04, 0x08, 0x72, 0x09, 0x04 }, // 177 - { 0x18, 0xA0, 0xA2, 0xA1, 0x78 }, // 178 - { 0x00, 0x07, 0x05, 0x07, 0x00 }, // 179 - { 0x1E, 0xA1, 0xA1, 0x61, 0x12 }, // 180 - { 0x18, 0xA4, 0xA4, 0x64, 0x24 }, // 181 - { 0x7C, 0x0A, 0x11, 0x22, 0x7D }, // 182 - { 0x78, 0x0A, 0x09, 0x0A, 0x71 }, // 183 - { 0x00, 0x00, 0x7D, 0x00, 0x00 }, // 184 - { 0x30, 0x48, 0x45, 0x40, 0x20 }, // 185 - { 0x5D, 0x22, 0x22, 0x22, 0x5D }, // 186 - { 0x48, 0x7E, 0x49, 0x41, 0x02 }, // 187 - { 0x2B, 0x2C, 0x78, 0x2C, 0x2B }, // 188 - { 0x08, 0x56, 0x55, 0x35, 0x08 }, // 189 - { 0x40, 0x48, 0x3E, 0x09, 0x01 }, // 190 - { 0x18, 0x24, 0x7E, 0x24, 0x24 }, // 191 - { 0x20, 0x56, 0x55, 0x56, 0x78 }, // 192 - { 0x38, 0x56, 0x55, 0x56, 0x18 }, // 193 - { 0x30, 0x4A, 0x49, 0x4A, 0x30 }, // 194 - { 0x38, 0x42, 0x41, 0x42, 0x78 }, // 195 - { 0x20, 0x54, 0x56, 0x55, 0x78 }, // 196 - { 0x38, 0x54, 0x56, 0x55, 0x18 }, // 197 - { 0x30, 0x48, 0x4A, 0x49, 0x30 }, // 198 - { 0x38, 0x40, 0x42, 0x41, 0x78 }, // 199 - { 0x20, 0x55, 0x56, 0x54, 0x78 }, // 200 - { 0x38, 0x55, 0x56, 0x54, 0x18 }, // 201 - { 0x30, 0x49, 0x4A, 0x48, 0x30 }, // 202 - { 0x38, 0x41, 0x42, 0x40, 0x78 }, // 203 - { 0x20, 0x55, 0x54, 0x55, 0x78 }, // 204 - { 0x38, 0x55, 0x54, 0x55, 0x18 }, // 205 - { 0x30, 0x49, 0x48, 0x49, 0x30 }, // 206 - { 0x38, 0x41, 0x40, 0x41, 0x78 }, // 207 - { 0x78, 0x17, 0x15, 0x17, 0x78 }, // 208 - { 0x00, 0x4A, 0x79, 0x42, 0x00 }, // 209 - { 0x5C, 0x32, 0x2A, 0x26, 0x1D }, // 210 - { 0x7E, 0x09, 0x7E, 0x49, 0x49 }, // 211 - { 0x20, 0x57, 0x55, 0x57, 0x78 }, // 212 - { 0x00, 0x48, 0x7A, 0x41, 0x00 }, // 213 - { 0x58, 0x24, 0x54, 0x48, 0x34 }, // 214 - { 0x74, 0x54, 0x7C, 0x54, 0x5C }, // 215 - { 0x78, 0x15, 0x14, 0x15, 0x78 }, // 216 - { 0x00, 0x49, 0x7A, 0x40, 0x00 }, // 217 - { 0x38, 0x45, 0x44, 0x45, 0x38 }, // 218 - { 0x3C, 0x41, 0x40, 0x41, 0x3C }, // 219 - { 0x7C, 0x54, 0x56, 0x55, 0x44 }, // 220 - { 0x00, 0x49, 0x78, 0x41, 0x00 }, // 221 - { 0xFE, 0x25, 0x25, 0x25, 0x1A }, // 222 - { 0x38, 0x46, 0x45, 0x46, 0x38 }, // 223 - { 0x78, 0x14, 0x16, 0x15, 0x78 }, // 224 - { 0x7A, 0x15, 0x16, 0x15, 0x78 }, // 225 - { 0x22, 0x55, 0x56, 0x55, 0x78 }, // 226 - { 0x08, 0x7F, 0x49, 0x22, 0x1C }, // 227 - { 0x30, 0x48, 0x4A, 0x3F, 0x02 }, // 228 - { 0x00, 0x44, 0x7E, 0x45, 0x00 }, // 229 - { 0x00, 0x45, 0x7E, 0x44, 0x00 }, // 230 - { 0x38, 0x44, 0x46, 0x45, 0x38 }, // 231 - { 0x38, 0x45, 0x46, 0x44, 0x38 }, // 232 - { 0x3A, 0x45, 0x46, 0x45, 0x38 }, // 233 - { 0x30, 0x4A, 0x49, 0x4A, 0x31 }, // 234 - { 0x48, 0x55, 0x56, 0x55, 0x24 }, // 235 - { 0x40, 0x51, 0x2A, 0x09, 0x00 }, // 236 - { 0x3C, 0x40, 0x42, 0x41, 0x3C }, // 237 - { 0x04, 0x09, 0x70, 0x09, 0x04 }, // 238 - { 0x18, 0xA1, 0xA0, 0xA1, 0x78 }, // 239 - { 0x41, 0x7F, 0x55, 0x14, 0x08 }, // 240 - { 0x00, 0xFE, 0x24, 0x24, 0x18 }, // 241 - { 0x00, 0x18, 0x18, 0x00, 0x00 }, // 242 - { 0x7C, 0x20, 0x20, 0x1C, 0x20 }, // 243 - { 0x06, 0x4F, 0x7F, 0x01, 0x7F }, // 244 - { 0x15, 0x1F, 0x38, 0x24, 0x72 }, // 245 - { 0x04, 0x04, 0x04, 0x04, 0x04 }, // 246 - { 0x17, 0x08, 0x34, 0x22, 0x70 }, // 247 - { 0x17, 0x08, 0x04, 0x6A, 0x58 }, // 248 - { 0x00, 0x28, 0x35, 0x35, 0x2E }, // 249 - { 0x26, 0x29, 0x29, 0x29, 0x26 }, // 250 - { 0x08, 0x14, 0x2A, 0x14, 0x22 }, // 251 - { 0x7F, 0x7F, 0x7F, 0x7F, 0x7F }, // 252 - { 0x22, 0x14, 0x2A, 0x14, 0x08 }, // 253 - { 0x00, 0x24, 0x2E, 0x24, 0x00 }, // 254 - { 0x00, 0x00, 0x00, 0x00, 0x00 } // 255 - }; + private static final int[][] sFontRoman8_B = + { + {0x00, 0x00, 0x00, 0x00, 0x00}, // 32 + {0x00, 0x00, 0x5F, 0x00, 0x00}, // 33 + {0x00, 0x07, 0x00, 0x07, 0x00}, // 34 + {0x14, 0x7F, 0x14, 0x7F, 0x14}, // 35 + {0x24, 0x2A, 0x7F, 0x2A, 0x12}, // 36 + {0x23, 0x13, 0x08, 0x64, 0x62}, // 37 + {0x36, 0x49, 0x56, 0x20, 0x50}, // 38 + {0x00, 0x00, 0x07, 0x00, 0x00}, // 39 + {0x00, 0x1C, 0x22, 0x41, 0x00}, // 40 + {0x00, 0x41, 0x22, 0x1C, 0x00}, // 41 + {0x08, 0x2A, 0x1C, 0x2A, 0x08}, // 42 + {0x08, 0x08, 0x3E, 0x08, 0x08}, // 43 + {0x00, 0xB0, 0x70, 0x00, 0x00}, // 44 + {0x08, 0x08, 0x08, 0x08, 0x08}, // 45 + {0x00, 0x60, 0x60, 0x00, 0x00}, // 46 + {0x20, 0x10, 0x08, 0x04, 0x02}, // 47 + {0x3C, 0x62, 0x52, 0x4A, 0x3C}, // 48 + {0x00, 0x44, 0x7E, 0x40, 0x00}, // 49 + {0x64, 0x52, 0x4A, 0x4A, 0x44}, // 50 + {0x24, 0x42, 0x4A, 0x4A, 0x34}, // 51 + {0x10, 0x18, 0x14, 0x7E, 0x10}, // 52 + {0x2E, 0x4A, 0x4A, 0x4A, 0x32}, // 53 + {0x38, 0x54, 0x52, 0x52, 0x20}, // 54 + {0x02, 0x62, 0x12, 0x0A, 0x06}, // 55 + {0x34, 0x4A, 0x4A, 0x4A, 0x34}, // 56 + {0x04, 0x4A, 0x4A, 0x2A, 0x1C}, // 57 + {0x00, 0x36, 0x36, 0x00, 0x00}, // 58 + {0x00, 0xB6, 0x76, 0x00, 0x00}, // 59 + {0x08, 0x14, 0x22, 0x41, 0x00}, // 60 + {0x14, 0x14, 0x14, 0x14, 0x14}, // 61 + {0x41, 0x22, 0x14, 0x08, 0x00}, // 62 + {0x02, 0x01, 0x51, 0x09, 0x06}, // 63 + {0x3E, 0x41, 0x5D, 0x49, 0x4E}, // 64 + {0x7C, 0x12, 0x12, 0x12, 0x7C}, // 65 + {0x7E, 0x4A, 0x4A, 0x4A, 0x34}, // 66 + {0x3C, 0x42, 0x42, 0x42, 0x24}, // 67 + {0x7E, 0x42, 0x42, 0x24, 0x18}, // 68 + {0x7E, 0x4A, 0x4A, 0x4A, 0x42}, // 69 + {0x7E, 0x0A, 0x0A, 0x0A, 0x02}, // 70 + {0x3C, 0x42, 0x42, 0x52, 0x74}, // 71 + {0x7E, 0x08, 0x08, 0x08, 0x7E}, // 72 + {0x00, 0x42, 0x7E, 0x42, 0x00}, // 73 + {0x20, 0x40, 0x40, 0x40, 0x3E}, // 74 + {0x7E, 0x08, 0x14, 0x22, 0x40}, // 75 + {0x7E, 0x40, 0x40, 0x40, 0x40}, // 76 + {0x7E, 0x04, 0x18, 0x04, 0x7E}, // 77 + {0x7E, 0x04, 0x08, 0x10, 0x7E}, // 78 + {0x3C, 0x42, 0x42, 0x42, 0x3C}, // 79 + {0x7E, 0x12, 0x12, 0x12, 0x0C}, // 80 + {0x3C, 0x42, 0x52, 0x22, 0x5C}, // 81 + {0x7E, 0x12, 0x12, 0x32, 0x4C}, // 82 + {0x24, 0x4A, 0x4A, 0x4A, 0x30}, // 83 + {0x02, 0x02, 0x7E, 0x02, 0x02}, // 84 + {0x3E, 0x40, 0x40, 0x40, 0x3E}, // 85 + {0x0E, 0x30, 0x40, 0x30, 0x0E}, // 86 + {0x7E, 0x20, 0x18, 0x20, 0x7E}, // 87 + {0x42, 0x24, 0x18, 0x24, 0x42}, // 88 + {0x06, 0x08, 0x70, 0x08, 0x06}, // 89 + {0x62, 0x52, 0x4A, 0x46, 0x42}, // 90 + {0x00, 0x7F, 0x41, 0x41, 0x00}, // 91 + {0x02, 0x04, 0x08, 0x10, 0x20}, // 92 + {0x00, 0x41, 0x41, 0x7F, 0x00}, // 93 + {0x04, 0x02, 0x01, 0x02, 0x04}, // 94 + {0x80, 0x80, 0x80, 0x80, 0x80}, // 95 + {0x00, 0x03, 0x04, 0x00, 0x00}, // 96 + {0x20, 0x54, 0x54, 0x54, 0x78}, // 97 + {0x7F, 0x44, 0x44, 0x44, 0x38}, // 98 + {0x38, 0x44, 0x44, 0x44, 0x44}, // 99 + {0x38, 0x44, 0x44, 0x44, 0x7F}, // 100 + {0x38, 0x54, 0x54, 0x54, 0x18}, // 101 + {0x08, 0x7E, 0x09, 0x02, 0x00}, // 102 + {0x18, 0xA4, 0xA4, 0xA4, 0x78}, // 103 + {0x7F, 0x04, 0x04, 0x04, 0x78}, // 104 + {0x00, 0x44, 0x7D, 0x40, 0x00}, // 105 + {0x40, 0x80, 0x84, 0x7D, 0x00}, // 106 + {0x7F, 0x10, 0x28, 0x44, 0x00}, // 107 + {0x00, 0x41, 0x7F, 0x40, 0x00}, // 108 + {0x7C, 0x04, 0x38, 0x04, 0x78}, // 109 + {0x7C, 0x04, 0x04, 0x04, 0x78}, // 110 + {0x38, 0x44, 0x44, 0x44, 0x38}, // 111 + {0xFC, 0x24, 0x24, 0x24, 0x18}, // 112 + {0x18, 0x24, 0x24, 0x24, 0xFC}, // 113 + {0x7C, 0x08, 0x04, 0x04, 0x04}, // 114 + {0x48, 0x54, 0x54, 0x54, 0x24}, // 115 + {0x04, 0x3F, 0x44, 0x20, 0x00}, // 116 + {0x3C, 0x40, 0x40, 0x40, 0x7C}, // 117 + {0x1C, 0x20, 0x40, 0x20, 0x1C}, // 118 + {0x3C, 0x40, 0x30, 0x40, 0x3C}, // 119 + {0x44, 0x28, 0x10, 0x28, 0x44}, // 120 + {0x1C, 0xA0, 0xA0, 0xA0, 0x7C}, // 121 + {0x44, 0x64, 0x54, 0x4C, 0x44}, // 122 + {0x08, 0x36, 0x41, 0x41, 0x00}, // 123 + {0x00, 0x00, 0x7F, 0x00, 0x00}, // 124 + {0x00, 0x41, 0x41, 0x36, 0x08}, // 125 + {0x08, 0x04, 0x08, 0x10, 0x08}, // 126 + {0x55, 0x2A, 0x55, 0x2A, 0x55}, // 127 + {0x00, 0x00, 0x00, 0x00, 0x00}, // 128 + {0x08, 0x08, 0x2A, 0x08, 0x08}, // 129 + {0x22, 0x14, 0x08, 0x14, 0x22}, // 130 + {0x10, 0x20, 0x7F, 0x01, 0x01}, // 131 + {0x20, 0x40, 0x3E, 0x01, 0x02}, // 132 + {0x41, 0x63, 0x55, 0x49, 0x63}, // 133 + {0x7F, 0x7F, 0x3E, 0x1C, 0x08}, // 134 + {0x04, 0x7C, 0x04, 0x7C, 0x04}, // 135 + {0x30, 0x49, 0x4A, 0x4C, 0x38}, // 136 + {0x50, 0x58, 0x54, 0x52, 0x51}, // 137 + {0x51, 0x52, 0x54, 0x58, 0x50}, // 138 + {0x14, 0x34, 0x1C, 0x16, 0x14}, // 139 + {0x30, 0x48, 0x48, 0x30, 0x48}, // 140 + {0x08, 0x08, 0x2A, 0x1C, 0x08}, // 141 + {0x08, 0x1C, 0x2A, 0x08, 0x08}, // 142 + {0x7C, 0x20, 0x20, 0x1C, 0x20}, // 143 + {0x0F, 0x08, 0x00, 0x78, 0x28}, // 144 + {0x00, 0x07, 0x05, 0x07, 0x00}, // 145 + {0x08, 0x14, 0x2A, 0x14, 0x22}, // 146 + {0x22, 0x14, 0x2A, 0x14, 0x08}, // 147 + {0x7F, 0x08, 0x08, 0x08, 0x08}, // 148 + {0x00, 0x00, 0xF8, 0x00, 0x00}, // 149 + {0x00, 0xE8, 0xA8, 0xB8, 0x00}, // 150 + {0x00, 0x1D, 0x15, 0x17, 0x00}, // 151 + {0x00, 0x15, 0x15, 0x1F, 0x00}, // 152 + {0x00, 0x00, 0x68, 0x80, 0x00}, // 153 + {0x00, 0x80, 0x80, 0x74, 0x00}, // 154 + {0x60, 0x60, 0x00, 0x60, 0x60}, // 155 + {0x00, 0x00, 0x0D, 0x10, 0x00}, // 156 + {0x00, 0x10, 0x10, 0x0D, 0x00}, // 157 + {0x00, 0x1F, 0x04, 0x0A, 0x10}, // 158 + {0x00, 0x1E, 0x02, 0x02, 0x1C}, // 159 + {0x60, 0x50, 0x58, 0x64, 0x42}, // 160 + {0x78, 0x15, 0x16, 0x14, 0x78}, // 161 + {0x78, 0x16, 0x15, 0x16, 0x78}, // 162 + {0x7C, 0x55, 0x56, 0x54, 0x44}, // 163 + {0x7C, 0x56, 0x55, 0x56, 0x44}, // 164 + {0x7C, 0x55, 0x54, 0x55, 0x44}, // 165 + {0x00, 0x46, 0x7D, 0x46, 0x00}, // 166 + {0x00, 0x45, 0x7C, 0x45, 0x00}, // 167 + {0x00, 0x00, 0x02, 0x01, 0x00}, // 168 + {0x00, 0x01, 0x02, 0x00, 0x00}, // 169 + {0x00, 0x02, 0x01, 0x02, 0x00}, // 170 + {0x00, 0x01, 0x00, 0x01, 0x00}, // 171 + {0x02, 0x01, 0x02, 0x04, 0x02}, // 172 + {0x3C, 0x41, 0x42, 0x40, 0x3C}, // 173 + {0x38, 0x42, 0x41, 0x42, 0x38}, // 174 + {0x58, 0x7E, 0x59, 0x41, 0x02}, // 175 + {0x01, 0x01, 0x01, 0x01, 0x01}, // 176 + {0x04, 0x08, 0x72, 0x09, 0x04}, // 177 + {0x18, 0xA0, 0xA2, 0xA1, 0x78}, // 178 + {0x00, 0x07, 0x05, 0x07, 0x00}, // 179 + {0x1E, 0xA1, 0xA1, 0x61, 0x12}, // 180 + {0x18, 0xA4, 0xA4, 0x64, 0x24}, // 181 + {0x7C, 0x0A, 0x11, 0x22, 0x7D}, // 182 + {0x78, 0x0A, 0x09, 0x0A, 0x71}, // 183 + {0x00, 0x00, 0x7D, 0x00, 0x00}, // 184 + {0x30, 0x48, 0x45, 0x40, 0x20}, // 185 + {0x5D, 0x22, 0x22, 0x22, 0x5D}, // 186 + {0x48, 0x7E, 0x49, 0x41, 0x02}, // 187 + {0x2B, 0x2C, 0x78, 0x2C, 0x2B}, // 188 + {0x08, 0x56, 0x55, 0x35, 0x08}, // 189 + {0x40, 0x48, 0x3E, 0x09, 0x01}, // 190 + {0x18, 0x24, 0x7E, 0x24, 0x24}, // 191 + {0x20, 0x56, 0x55, 0x56, 0x78}, // 192 + {0x38, 0x56, 0x55, 0x56, 0x18}, // 193 + {0x30, 0x4A, 0x49, 0x4A, 0x30}, // 194 + {0x38, 0x42, 0x41, 0x42, 0x78}, // 195 + {0x20, 0x54, 0x56, 0x55, 0x78}, // 196 + {0x38, 0x54, 0x56, 0x55, 0x18}, // 197 + {0x30, 0x48, 0x4A, 0x49, 0x30}, // 198 + {0x38, 0x40, 0x42, 0x41, 0x78}, // 199 + {0x20, 0x55, 0x56, 0x54, 0x78}, // 200 + {0x38, 0x55, 0x56, 0x54, 0x18}, // 201 + {0x30, 0x49, 0x4A, 0x48, 0x30}, // 202 + {0x38, 0x41, 0x42, 0x40, 0x78}, // 203 + {0x20, 0x55, 0x54, 0x55, 0x78}, // 204 + {0x38, 0x55, 0x54, 0x55, 0x18}, // 205 + {0x30, 0x49, 0x48, 0x49, 0x30}, // 206 + {0x38, 0x41, 0x40, 0x41, 0x78}, // 207 + {0x78, 0x17, 0x15, 0x17, 0x78}, // 208 + {0x00, 0x4A, 0x79, 0x42, 0x00}, // 209 + {0x5C, 0x32, 0x2A, 0x26, 0x1D}, // 210 + {0x7E, 0x09, 0x7E, 0x49, 0x49}, // 211 + {0x20, 0x57, 0x55, 0x57, 0x78}, // 212 + {0x00, 0x48, 0x7A, 0x41, 0x00}, // 213 + {0x58, 0x24, 0x54, 0x48, 0x34}, // 214 + {0x74, 0x54, 0x7C, 0x54, 0x5C}, // 215 + {0x78, 0x15, 0x14, 0x15, 0x78}, // 216 + {0x00, 0x49, 0x7A, 0x40, 0x00}, // 217 + {0x38, 0x45, 0x44, 0x45, 0x38}, // 218 + {0x3C, 0x41, 0x40, 0x41, 0x3C}, // 219 + {0x7C, 0x54, 0x56, 0x55, 0x44}, // 220 + {0x00, 0x49, 0x78, 0x41, 0x00}, // 221 + {0xFE, 0x25, 0x25, 0x25, 0x1A}, // 222 + {0x38, 0x46, 0x45, 0x46, 0x38}, // 223 + {0x78, 0x14, 0x16, 0x15, 0x78}, // 224 + {0x7A, 0x15, 0x16, 0x15, 0x78}, // 225 + {0x22, 0x55, 0x56, 0x55, 0x78}, // 226 + {0x08, 0x7F, 0x49, 0x22, 0x1C}, // 227 + {0x30, 0x48, 0x4A, 0x3F, 0x02}, // 228 + {0x00, 0x44, 0x7E, 0x45, 0x00}, // 229 + {0x00, 0x45, 0x7E, 0x44, 0x00}, // 230 + {0x38, 0x44, 0x46, 0x45, 0x38}, // 231 + {0x38, 0x45, 0x46, 0x44, 0x38}, // 232 + {0x3A, 0x45, 0x46, 0x45, 0x38}, // 233 + {0x30, 0x4A, 0x49, 0x4A, 0x31}, // 234 + {0x48, 0x55, 0x56, 0x55, 0x24}, // 235 + {0x40, 0x51, 0x2A, 0x09, 0x00}, // 236 + {0x3C, 0x40, 0x42, 0x41, 0x3C}, // 237 + {0x04, 0x09, 0x70, 0x09, 0x04}, // 238 + {0x18, 0xA1, 0xA0, 0xA1, 0x78}, // 239 + {0x41, 0x7F, 0x55, 0x14, 0x08}, // 240 + {0x00, 0xFE, 0x24, 0x24, 0x18}, // 241 + {0x00, 0x18, 0x18, 0x00, 0x00}, // 242 + {0x7C, 0x20, 0x20, 0x1C, 0x20}, // 243 + {0x06, 0x4F, 0x7F, 0x01, 0x7F}, // 244 + {0x15, 0x1F, 0x38, 0x24, 0x72}, // 245 + {0x04, 0x04, 0x04, 0x04, 0x04}, // 246 + {0x17, 0x08, 0x34, 0x22, 0x70}, // 247 + {0x17, 0x08, 0x04, 0x6A, 0x58}, // 248 + {0x00, 0x28, 0x35, 0x35, 0x2E}, // 249 + {0x26, 0x29, 0x29, 0x29, 0x26}, // 250 + {0x08, 0x14, 0x2A, 0x14, 0x22}, // 251 + {0x7F, 0x7F, 0x7F, 0x7F, 0x7F}, // 252 + {0x22, 0x14, 0x2A, 0x14, 0x08}, // 253 + {0x00, 0x24, 0x2E, 0x24, 0x00}, // 254 + {0x00, 0x00, 0x00, 0x00, 0x00} // 255 + }; /** * HP82240B ECMA94 font table. */ - private static final int sFontEcma94_B[][] = - { - { 0x00, 0x00, 0x00, 0x00, 0x00 }, // 32 - { 0x00, 0x00, 0x5F, 0x00, 0x00 }, // 33 - { 0x00, 0x07, 0x00, 0x07, 0x00 }, // 34 - { 0x14, 0x7F, 0x14, 0x7F, 0x14 }, // 35 - { 0x24, 0x2A, 0x7F, 0x2A, 0x12 }, // 36 - { 0x23, 0x13, 0x08, 0x64, 0x62 }, // 37 - { 0x36, 0x49, 0x56, 0x20, 0x50 }, // 38 - { 0x00, 0x00, 0x07, 0x00, 0x00 }, // 39 - { 0x00, 0x1C, 0x22, 0x41, 0x00 }, // 40 - { 0x00, 0x41, 0x22, 0x1C, 0x00 }, // 41 - { 0x08, 0x2A, 0x1C, 0x2A, 0x08 }, // 42 - { 0x08, 0x08, 0x3E, 0x08, 0x08 }, // 43 - { 0x00, 0xB0, 0x70, 0x00, 0x00 }, // 44 - { 0x08, 0x08, 0x08, 0x08, 0x08 }, // 45 - { 0x00, 0x60, 0x60, 0x00, 0x00 }, // 46 - { 0x20, 0x10, 0x08, 0x04, 0x02 }, // 47 - { 0x3C, 0x62, 0x52, 0x4A, 0x3C }, // 48 - { 0x00, 0x44, 0x7E, 0x40, 0x00 }, // 49 - { 0x64, 0x52, 0x4A, 0x4A, 0x44 }, // 50 - { 0x24, 0x42, 0x4A, 0x4A, 0x34 }, // 51 - { 0x10, 0x18, 0x14, 0x7E, 0x10 }, // 52 - { 0x2E, 0x4A, 0x4A, 0x4A, 0x32 }, // 53 - { 0x38, 0x54, 0x52, 0x52, 0x20 }, // 54 - { 0x02, 0x62, 0x12, 0x0A, 0x06 }, // 55 - { 0x34, 0x4A, 0x4A, 0x4A, 0x34 }, // 56 - { 0x04, 0x4A, 0x4A, 0x2A, 0x1C }, // 57 - { 0x00, 0x36, 0x36, 0x00, 0x00 }, // 58 - { 0x00, 0xB6, 0x76, 0x00, 0x00 }, // 59 - { 0x08, 0x14, 0x22, 0x41, 0x00 }, // 60 - { 0x14, 0x14, 0x14, 0x14, 0x14 }, // 61 - { 0x41, 0x22, 0x14, 0x08, 0x00 }, // 62 - { 0x02, 0x01, 0x51, 0x09, 0x06 }, // 63 - { 0x3E, 0x41, 0x5D, 0x49, 0x4E }, // 64 - { 0x7C, 0x12, 0x12, 0x12, 0x7C }, // 65 - { 0x7E, 0x4A, 0x4A, 0x4A, 0x34 }, // 66 - { 0x3C, 0x42, 0x42, 0x42, 0x24 }, // 67 - { 0x7E, 0x42, 0x42, 0x24, 0x18 }, // 68 - { 0x7E, 0x4A, 0x4A, 0x4A, 0x42 }, // 69 - { 0x7E, 0x0A, 0x0A, 0x0A, 0x02 }, // 70 - { 0x3C, 0x42, 0x42, 0x52, 0x74 }, // 71 - { 0x7E, 0x08, 0x08, 0x08, 0x7E }, // 72 - { 0x00, 0x42, 0x7E, 0x42, 0x00 }, // 73 - { 0x20, 0x40, 0x40, 0x40, 0x3E }, // 74 - { 0x7E, 0x08, 0x14, 0x22, 0x40 }, // 75 - { 0x7E, 0x40, 0x40, 0x40, 0x40 }, // 76 - { 0x7E, 0x04, 0x18, 0x04, 0x7E }, // 77 - { 0x7E, 0x04, 0x08, 0x10, 0x7E }, // 78 - { 0x3C, 0x42, 0x42, 0x42, 0x3C }, // 79 - { 0x7E, 0x12, 0x12, 0x12, 0x0C }, // 80 - { 0x3C, 0x42, 0x52, 0x22, 0x5C }, // 81 - { 0x7E, 0x12, 0x12, 0x32, 0x4C }, // 82 - { 0x24, 0x4A, 0x4A, 0x4A, 0x30 }, // 83 - { 0x02, 0x02, 0x7E, 0x02, 0x02 }, // 84 - { 0x3E, 0x40, 0x40, 0x40, 0x3E }, // 85 - { 0x0E, 0x30, 0x40, 0x30, 0x0E }, // 86 - { 0x7E, 0x20, 0x18, 0x20, 0x7E }, // 87 - { 0x42, 0x24, 0x18, 0x24, 0x42 }, // 88 - { 0x06, 0x08, 0x70, 0x08, 0x06 }, // 89 - { 0x62, 0x52, 0x4A, 0x46, 0x42 }, // 90 - { 0x00, 0x7F, 0x41, 0x41, 0x00 }, // 91 - { 0x02, 0x04, 0x08, 0x10, 0x20 }, // 92 - { 0x00, 0x41, 0x41, 0x7F, 0x00 }, // 93 - { 0x04, 0x02, 0x01, 0x02, 0x04 }, // 94 - { 0x80, 0x80, 0x80, 0x80, 0x80 }, // 95 - { 0x00, 0x03, 0x04, 0x00, 0x00 }, // 96 - { 0x20, 0x54, 0x54, 0x54, 0x78 }, // 97 - { 0x7F, 0x44, 0x44, 0x44, 0x38 }, // 98 - { 0x38, 0x44, 0x44, 0x44, 0x44 }, // 99 - { 0x38, 0x44, 0x44, 0x44, 0x7F }, // 100 - { 0x38, 0x54, 0x54, 0x54, 0x18 }, // 101 - { 0x08, 0x7E, 0x09, 0x02, 0x00 }, // 102 - { 0x18, 0xA4, 0xA4, 0xA4, 0x78 }, // 103 - { 0x7F, 0x04, 0x04, 0x04, 0x78 }, // 104 - { 0x00, 0x44, 0x7D, 0x40, 0x00 }, // 105 - { 0x40, 0x80, 0x84, 0x7D, 0x00 }, // 106 - { 0x7F, 0x10, 0x28, 0x44, 0x00 }, // 107 - { 0x00, 0x41, 0x7F, 0x40, 0x00 }, // 108 - { 0x7C, 0x04, 0x38, 0x04, 0x78 }, // 109 - { 0x7C, 0x04, 0x04, 0x04, 0x78 }, // 110 - { 0x38, 0x44, 0x44, 0x44, 0x38 }, // 111 - { 0xFC, 0x24, 0x24, 0x24, 0x18 }, // 112 - { 0x18, 0x24, 0x24, 0x24, 0xFC }, // 113 - { 0x7C, 0x08, 0x04, 0x04, 0x04 }, // 114 - { 0x48, 0x54, 0x54, 0x54, 0x24 }, // 115 - { 0x04, 0x3F, 0x44, 0x20, 0x00 }, // 116 - { 0x3C, 0x40, 0x40, 0x40, 0x7C }, // 117 - { 0x1C, 0x20, 0x40, 0x20, 0x1C }, // 118 - { 0x3C, 0x40, 0x30, 0x40, 0x3C }, // 119 - { 0x44, 0x28, 0x10, 0x28, 0x44 }, // 120 - { 0x1C, 0xA0, 0xA0, 0xA0, 0x7C }, // 121 - { 0x44, 0x64, 0x54, 0x4C, 0x44 }, // 122 - { 0x08, 0x36, 0x41, 0x41, 0x00 }, // 123 - { 0x00, 0x00, 0x7F, 0x00, 0x00 }, // 124 - { 0x00, 0x41, 0x41, 0x36, 0x08 }, // 125 - { 0x08, 0x04, 0x08, 0x10, 0x08 }, // 126 - { 0x55, 0x2A, 0x55, 0x2A, 0x55 }, // 127 - { 0x60, 0x50, 0x58, 0x64, 0x42 }, // 128 - { 0x45, 0x29, 0x11, 0x29, 0x45 }, // 129 - { 0x06, 0x1A, 0x22, 0x1A, 0x06 }, // 130 - { 0x10, 0x20, 0x7F, 0x01, 0x01 }, // 131 - { 0x20, 0x40, 0x3E, 0x01, 0x02 }, // 132 - { 0x41, 0x63, 0x55, 0x49, 0x63 }, // 133 - { 0x7F, 0x7F, 0x3E, 0x1C, 0x08 }, // 134 - { 0x04, 0x7C, 0x04, 0x7C, 0x04 }, // 135 - { 0x30, 0x49, 0x4A, 0x4C, 0x38 }, // 136 - { 0x50, 0x58, 0x54, 0x52, 0x51 }, // 137 - { 0x51, 0x52, 0x54, 0x58, 0x50 }, // 138 - { 0x14, 0x34, 0x1C, 0x16, 0x14 }, // 139 - { 0x30, 0x48, 0x48, 0x30, 0x48 }, // 140 - { 0x08, 0x08, 0x2A, 0x1C, 0x08 }, // 141 - { 0x08, 0x1C, 0x2A, 0x08, 0x08 }, // 142 - { 0x10, 0x20, 0x7F, 0x20, 0x10 }, // 143 - { 0x04, 0x02, 0x7F, 0x02, 0x04 }, // 144 - { 0x08, 0x04, 0x08, 0x70, 0x0C }, // 145 - { 0x30, 0x4A, 0x4D, 0x38, 0x00 }, // 146 - { 0x00, 0x38, 0x54, 0x54, 0x54 }, // 147 - { 0x08, 0x04, 0x38, 0x04, 0xF8 }, // 148 - { 0x3E, 0x49, 0x49, 0x3E, 0x00 }, // 149 - { 0x46, 0x28, 0x10, 0x20, 0x40 }, // 150 - { 0x80, 0x7C, 0x12, 0x12, 0x0C }, // 151 - { 0x38, 0x44, 0x44, 0x3C, 0x04 }, // 152 - { 0x08, 0x04, 0x3C, 0x44, 0x24 }, // 153 - { 0x3C, 0x40, 0x30, 0x44, 0x38 }, // 154 - { 0x30, 0x28, 0x24, 0x28, 0x30 }, // 155 - { 0x01, 0x7F, 0x01, 0x7F, 0x01 }, // 156 - { 0x5E, 0x61, 0x01, 0x61, 0x5E }, // 157 - { 0x7F, 0x7F, 0x7F, 0x7F, 0x7F }, // 158 - { 0x18, 0x24, 0x18, 0x24, 0x18 }, // 159 - { 0x00, 0x00, 0x00, 0x00, 0x00 }, // 160 - { 0x00, 0x00, 0x7D, 0x00, 0x00 }, // 161 - { 0x18, 0x24, 0x7E, 0x24, 0x24 }, // 162 - { 0x48, 0x7E, 0x49, 0x41, 0x02 }, // 163 - { 0x5D, 0x22, 0x22, 0x22, 0x5D }, // 164 - { 0x2B, 0x2C, 0x78, 0x2C, 0x2B }, // 165 - { 0x00, 0x00, 0x77, 0x00, 0x00 }, // 166 - { 0x08, 0x56, 0x55, 0x35, 0x08 }, // 167 - { 0x00, 0x01, 0x00, 0x01, 0x00 }, // 168 - { 0x3E, 0x5D, 0x55, 0x41, 0x3E }, // 169 - { 0x00, 0x28, 0x35, 0x35, 0x2E }, // 170 - { 0x08, 0x14, 0x2A, 0x14, 0x22 }, // 171 - { 0x08, 0x08, 0x08, 0x18, 0x00 }, // 172 - { 0x08, 0x08, 0x08, 0x08, 0x00 }, // 173 - { 0x3E, 0x5D, 0x4D, 0x51, 0x3E }, // 174 - { 0x01, 0x01, 0x01, 0x01, 0x01 }, // 175 - { 0x00, 0x07, 0x05, 0x07, 0x00 }, // 176 - { 0x00, 0x24, 0x2E, 0x24, 0x00 }, // 177 - { 0x00, 0x1D, 0x15, 0x17, 0x00 }, // 178 - { 0x00, 0x15, 0x15, 0x1F, 0x00 }, // 179 - { 0x00, 0x00, 0x02, 0x01, 0x00 }, // 180 - { 0x7C, 0x20, 0x20, 0x1C, 0x20 }, // 181 - { 0x06, 0x4F, 0x7F, 0x01, 0x7F }, // 182 - { 0x00, 0x18, 0x18, 0x00, 0x00 }, // 183 - { 0x00, 0x80, 0xA0, 0x40, 0x00 }, // 184 - { 0x00, 0x09, 0x0F, 0x08, 0x00 }, // 185 - { 0x26, 0x29, 0x29, 0x29, 0x26 }, // 186 - { 0x22, 0x14, 0x2A, 0x14, 0x08 }, // 187 - { 0x17, 0x08, 0x34, 0x22, 0x70 }, // 188 - { 0x17, 0x08, 0x04, 0x6A, 0x58 }, // 189 - { 0x15, 0x1F, 0x38, 0x24, 0x72 }, // 190 - { 0x30, 0x48, 0x45, 0x40, 0x20 }, // 191 - { 0x78, 0x15, 0x16, 0x14, 0x78 }, // 192 - { 0x78, 0x14, 0x16, 0x15, 0x78 }, // 193 - { 0x78, 0x16, 0x15, 0x16, 0x78 }, // 194 - { 0x7A, 0x15, 0x16, 0x15, 0x78 }, // 195 - { 0x78, 0x15, 0x14, 0x15, 0x78 }, // 196 - { 0x78, 0x17, 0x15, 0x17, 0x78 }, // 197 - { 0x7E, 0x09, 0x7E, 0x49, 0x49 }, // 198 - { 0x1E, 0xA1, 0xA1, 0x61, 0x12 }, // 199 - { 0x7C, 0x55, 0x56, 0x54, 0x44 }, // 200 - { 0x7C, 0x54, 0x56, 0x55, 0x44 }, // 201 - { 0x7C, 0x56, 0x55, 0x56, 0x44 }, // 202 - { 0x7C, 0x55, 0x54, 0x55, 0x44 }, // 203 - { 0x00, 0x45, 0x7E, 0x44, 0x00 }, // 204 - { 0x00, 0x44, 0x7E, 0x45, 0x00 }, // 205 - { 0x00, 0x46, 0x7D, 0x46, 0x00 }, // 206 - { 0x00, 0x45, 0x7C, 0x45, 0x00 }, // 207 - { 0x08, 0x7F, 0x49, 0x22, 0x1C }, // 208 - { 0x7C, 0x0A, 0x11, 0x22, 0x7D }, // 209 - { 0x38, 0x45, 0x46, 0x44, 0x38 }, // 210 - { 0x38, 0x44, 0x46, 0x45, 0x38 }, // 211 - { 0x38, 0x46, 0x45, 0x46, 0x38 }, // 212 - { 0x3A, 0x45, 0x46, 0x45, 0x38 }, // 213 - { 0x38, 0x45, 0x44, 0x45, 0x38 }, // 214 - { 0x22, 0x14, 0x08, 0x14, 0x22 }, // 215 - { 0x5C, 0x32, 0x2A, 0x26, 0x1D }, // 216 - { 0x3C, 0x41, 0x42, 0x40, 0x3C }, // 217 - { 0x3C, 0x40, 0x42, 0x41, 0x3C }, // 218 - { 0x38, 0x42, 0x41, 0x42, 0x38 }, // 219 - { 0x3C, 0x41, 0x40, 0x41, 0x3C }, // 220 - { 0x04, 0x08, 0x72, 0x09, 0x04 }, // 221 - { 0x41, 0x7F, 0x55, 0x14, 0x08 }, // 222 - { 0xFE, 0x25, 0x25, 0x25, 0x1A }, // 223 - { 0x20, 0x55, 0x56, 0x54, 0x78 }, // 224 - { 0x20, 0x54, 0x56, 0x55, 0x78 }, // 225 - { 0x20, 0x56, 0x55, 0x56, 0x78 }, // 226 - { 0x22, 0x55, 0x56, 0x55, 0x78 }, // 227 - { 0x20, 0x55, 0x54, 0x55, 0x78 }, // 228 - { 0x20, 0x57, 0x55, 0x57, 0x78 }, // 229 - { 0x74, 0x54, 0x7C, 0x54, 0x5C }, // 230 - { 0x18, 0xA4, 0xA4, 0x64, 0x24 }, // 231 - { 0x38, 0x55, 0x56, 0x54, 0x18 }, // 232 - { 0x38, 0x54, 0x56, 0x55, 0x18 }, // 233 - { 0x38, 0x56, 0x55, 0x56, 0x18 }, // 234 - { 0x38, 0x55, 0x54, 0x55, 0x18 }, // 235 - { 0x00, 0x49, 0x7A, 0x40, 0x00 }, // 236 - { 0x00, 0x48, 0x7A, 0x41, 0x00 }, // 237 - { 0x00, 0x4A, 0x79, 0x42, 0x00 }, // 238 - { 0x00, 0x49, 0x78, 0x41, 0x00 }, // 239 - { 0x30, 0x48, 0x4A, 0x3F, 0x02 }, // 240 - { 0x78, 0x0A, 0x09, 0x0A, 0x71 }, // 241 - { 0x30, 0x49, 0x4A, 0x48, 0x30 }, // 242 - { 0x30, 0x48, 0x4A, 0x49, 0x30 }, // 243 - { 0x30, 0x4A, 0x49, 0x4A, 0x30 }, // 244 - { 0x30, 0x4A, 0x49, 0x4A, 0x31 }, // 245 - { 0x30, 0x49, 0x48, 0x49, 0x30 }, // 246 - { 0x08, 0x08, 0x2A, 0x08, 0x08 }, // 247 - { 0x58, 0x24, 0x54, 0x48, 0x34 }, // 248 - { 0x38, 0x41, 0x42, 0x40, 0x78 }, // 249 - { 0x38, 0x40, 0x42, 0x41, 0x78 }, // 250 - { 0x38, 0x42, 0x41, 0x42, 0x78 }, // 251 - { 0x38, 0x41, 0x40, 0x41, 0x78 }, // 252 - { 0x18, 0xA0, 0xA2, 0xA1, 0x78 }, // 253 - { 0x00, 0xFE, 0x24, 0x24, 0x18 }, // 254 - { 0x18, 0xA1, 0xA0, 0xA1, 0x78 } // 255 - }; + private static final int[][] sFontEcma94_B = + { + {0x00, 0x00, 0x00, 0x00, 0x00}, // 32 + {0x00, 0x00, 0x5F, 0x00, 0x00}, // 33 + {0x00, 0x07, 0x00, 0x07, 0x00}, // 34 + {0x14, 0x7F, 0x14, 0x7F, 0x14}, // 35 + {0x24, 0x2A, 0x7F, 0x2A, 0x12}, // 36 + {0x23, 0x13, 0x08, 0x64, 0x62}, // 37 + {0x36, 0x49, 0x56, 0x20, 0x50}, // 38 + {0x00, 0x00, 0x07, 0x00, 0x00}, // 39 + {0x00, 0x1C, 0x22, 0x41, 0x00}, // 40 + {0x00, 0x41, 0x22, 0x1C, 0x00}, // 41 + {0x08, 0x2A, 0x1C, 0x2A, 0x08}, // 42 + {0x08, 0x08, 0x3E, 0x08, 0x08}, // 43 + {0x00, 0xB0, 0x70, 0x00, 0x00}, // 44 + {0x08, 0x08, 0x08, 0x08, 0x08}, // 45 + {0x00, 0x60, 0x60, 0x00, 0x00}, // 46 + {0x20, 0x10, 0x08, 0x04, 0x02}, // 47 + {0x3C, 0x62, 0x52, 0x4A, 0x3C}, // 48 + {0x00, 0x44, 0x7E, 0x40, 0x00}, // 49 + {0x64, 0x52, 0x4A, 0x4A, 0x44}, // 50 + {0x24, 0x42, 0x4A, 0x4A, 0x34}, // 51 + {0x10, 0x18, 0x14, 0x7E, 0x10}, // 52 + {0x2E, 0x4A, 0x4A, 0x4A, 0x32}, // 53 + {0x38, 0x54, 0x52, 0x52, 0x20}, // 54 + {0x02, 0x62, 0x12, 0x0A, 0x06}, // 55 + {0x34, 0x4A, 0x4A, 0x4A, 0x34}, // 56 + {0x04, 0x4A, 0x4A, 0x2A, 0x1C}, // 57 + {0x00, 0x36, 0x36, 0x00, 0x00}, // 58 + {0x00, 0xB6, 0x76, 0x00, 0x00}, // 59 + {0x08, 0x14, 0x22, 0x41, 0x00}, // 60 + {0x14, 0x14, 0x14, 0x14, 0x14}, // 61 + {0x41, 0x22, 0x14, 0x08, 0x00}, // 62 + {0x02, 0x01, 0x51, 0x09, 0x06}, // 63 + {0x3E, 0x41, 0x5D, 0x49, 0x4E}, // 64 + {0x7C, 0x12, 0x12, 0x12, 0x7C}, // 65 + {0x7E, 0x4A, 0x4A, 0x4A, 0x34}, // 66 + {0x3C, 0x42, 0x42, 0x42, 0x24}, // 67 + {0x7E, 0x42, 0x42, 0x24, 0x18}, // 68 + {0x7E, 0x4A, 0x4A, 0x4A, 0x42}, // 69 + {0x7E, 0x0A, 0x0A, 0x0A, 0x02}, // 70 + {0x3C, 0x42, 0x42, 0x52, 0x74}, // 71 + {0x7E, 0x08, 0x08, 0x08, 0x7E}, // 72 + {0x00, 0x42, 0x7E, 0x42, 0x00}, // 73 + {0x20, 0x40, 0x40, 0x40, 0x3E}, // 74 + {0x7E, 0x08, 0x14, 0x22, 0x40}, // 75 + {0x7E, 0x40, 0x40, 0x40, 0x40}, // 76 + {0x7E, 0x04, 0x18, 0x04, 0x7E}, // 77 + {0x7E, 0x04, 0x08, 0x10, 0x7E}, // 78 + {0x3C, 0x42, 0x42, 0x42, 0x3C}, // 79 + {0x7E, 0x12, 0x12, 0x12, 0x0C}, // 80 + {0x3C, 0x42, 0x52, 0x22, 0x5C}, // 81 + {0x7E, 0x12, 0x12, 0x32, 0x4C}, // 82 + {0x24, 0x4A, 0x4A, 0x4A, 0x30}, // 83 + {0x02, 0x02, 0x7E, 0x02, 0x02}, // 84 + {0x3E, 0x40, 0x40, 0x40, 0x3E}, // 85 + {0x0E, 0x30, 0x40, 0x30, 0x0E}, // 86 + {0x7E, 0x20, 0x18, 0x20, 0x7E}, // 87 + {0x42, 0x24, 0x18, 0x24, 0x42}, // 88 + {0x06, 0x08, 0x70, 0x08, 0x06}, // 89 + {0x62, 0x52, 0x4A, 0x46, 0x42}, // 90 + {0x00, 0x7F, 0x41, 0x41, 0x00}, // 91 + {0x02, 0x04, 0x08, 0x10, 0x20}, // 92 + {0x00, 0x41, 0x41, 0x7F, 0x00}, // 93 + {0x04, 0x02, 0x01, 0x02, 0x04}, // 94 + {0x80, 0x80, 0x80, 0x80, 0x80}, // 95 + {0x00, 0x03, 0x04, 0x00, 0x00}, // 96 + {0x20, 0x54, 0x54, 0x54, 0x78}, // 97 + {0x7F, 0x44, 0x44, 0x44, 0x38}, // 98 + {0x38, 0x44, 0x44, 0x44, 0x44}, // 99 + {0x38, 0x44, 0x44, 0x44, 0x7F}, // 100 + {0x38, 0x54, 0x54, 0x54, 0x18}, // 101 + {0x08, 0x7E, 0x09, 0x02, 0x00}, // 102 + {0x18, 0xA4, 0xA4, 0xA4, 0x78}, // 103 + {0x7F, 0x04, 0x04, 0x04, 0x78}, // 104 + {0x00, 0x44, 0x7D, 0x40, 0x00}, // 105 + {0x40, 0x80, 0x84, 0x7D, 0x00}, // 106 + {0x7F, 0x10, 0x28, 0x44, 0x00}, // 107 + {0x00, 0x41, 0x7F, 0x40, 0x00}, // 108 + {0x7C, 0x04, 0x38, 0x04, 0x78}, // 109 + {0x7C, 0x04, 0x04, 0x04, 0x78}, // 110 + {0x38, 0x44, 0x44, 0x44, 0x38}, // 111 + {0xFC, 0x24, 0x24, 0x24, 0x18}, // 112 + {0x18, 0x24, 0x24, 0x24, 0xFC}, // 113 + {0x7C, 0x08, 0x04, 0x04, 0x04}, // 114 + {0x48, 0x54, 0x54, 0x54, 0x24}, // 115 + {0x04, 0x3F, 0x44, 0x20, 0x00}, // 116 + {0x3C, 0x40, 0x40, 0x40, 0x7C}, // 117 + {0x1C, 0x20, 0x40, 0x20, 0x1C}, // 118 + {0x3C, 0x40, 0x30, 0x40, 0x3C}, // 119 + {0x44, 0x28, 0x10, 0x28, 0x44}, // 120 + {0x1C, 0xA0, 0xA0, 0xA0, 0x7C}, // 121 + {0x44, 0x64, 0x54, 0x4C, 0x44}, // 122 + {0x08, 0x36, 0x41, 0x41, 0x00}, // 123 + {0x00, 0x00, 0x7F, 0x00, 0x00}, // 124 + {0x00, 0x41, 0x41, 0x36, 0x08}, // 125 + {0x08, 0x04, 0x08, 0x10, 0x08}, // 126 + {0x55, 0x2A, 0x55, 0x2A, 0x55}, // 127 + {0x60, 0x50, 0x58, 0x64, 0x42}, // 128 + {0x45, 0x29, 0x11, 0x29, 0x45}, // 129 + {0x06, 0x1A, 0x22, 0x1A, 0x06}, // 130 + {0x10, 0x20, 0x7F, 0x01, 0x01}, // 131 + {0x20, 0x40, 0x3E, 0x01, 0x02}, // 132 + {0x41, 0x63, 0x55, 0x49, 0x63}, // 133 + {0x7F, 0x7F, 0x3E, 0x1C, 0x08}, // 134 + {0x04, 0x7C, 0x04, 0x7C, 0x04}, // 135 + {0x30, 0x49, 0x4A, 0x4C, 0x38}, // 136 + {0x50, 0x58, 0x54, 0x52, 0x51}, // 137 + {0x51, 0x52, 0x54, 0x58, 0x50}, // 138 + {0x14, 0x34, 0x1C, 0x16, 0x14}, // 139 + {0x30, 0x48, 0x48, 0x30, 0x48}, // 140 + {0x08, 0x08, 0x2A, 0x1C, 0x08}, // 141 + {0x08, 0x1C, 0x2A, 0x08, 0x08}, // 142 + {0x10, 0x20, 0x7F, 0x20, 0x10}, // 143 + {0x04, 0x02, 0x7F, 0x02, 0x04}, // 144 + {0x08, 0x04, 0x08, 0x70, 0x0C}, // 145 + {0x30, 0x4A, 0x4D, 0x38, 0x00}, // 146 + {0x00, 0x38, 0x54, 0x54, 0x54}, // 147 + {0x08, 0x04, 0x38, 0x04, 0xF8}, // 148 + {0x3E, 0x49, 0x49, 0x3E, 0x00}, // 149 + {0x46, 0x28, 0x10, 0x20, 0x40}, // 150 + {0x80, 0x7C, 0x12, 0x12, 0x0C}, // 151 + {0x38, 0x44, 0x44, 0x3C, 0x04}, // 152 + {0x08, 0x04, 0x3C, 0x44, 0x24}, // 153 + {0x3C, 0x40, 0x30, 0x44, 0x38}, // 154 + {0x30, 0x28, 0x24, 0x28, 0x30}, // 155 + {0x01, 0x7F, 0x01, 0x7F, 0x01}, // 156 + {0x5E, 0x61, 0x01, 0x61, 0x5E}, // 157 + {0x7F, 0x7F, 0x7F, 0x7F, 0x7F}, // 158 + {0x18, 0x24, 0x18, 0x24, 0x18}, // 159 + {0x00, 0x00, 0x00, 0x00, 0x00}, // 160 + {0x00, 0x00, 0x7D, 0x00, 0x00}, // 161 + {0x18, 0x24, 0x7E, 0x24, 0x24}, // 162 + {0x48, 0x7E, 0x49, 0x41, 0x02}, // 163 + {0x5D, 0x22, 0x22, 0x22, 0x5D}, // 164 + {0x2B, 0x2C, 0x78, 0x2C, 0x2B}, // 165 + {0x00, 0x00, 0x77, 0x00, 0x00}, // 166 + {0x08, 0x56, 0x55, 0x35, 0x08}, // 167 + {0x00, 0x01, 0x00, 0x01, 0x00}, // 168 + {0x3E, 0x5D, 0x55, 0x41, 0x3E}, // 169 + {0x00, 0x28, 0x35, 0x35, 0x2E}, // 170 + {0x08, 0x14, 0x2A, 0x14, 0x22}, // 171 + {0x08, 0x08, 0x08, 0x18, 0x00}, // 172 + {0x08, 0x08, 0x08, 0x08, 0x00}, // 173 + {0x3E, 0x5D, 0x4D, 0x51, 0x3E}, // 174 + {0x01, 0x01, 0x01, 0x01, 0x01}, // 175 + {0x00, 0x07, 0x05, 0x07, 0x00}, // 176 + {0x00, 0x24, 0x2E, 0x24, 0x00}, // 177 + {0x00, 0x1D, 0x15, 0x17, 0x00}, // 178 + {0x00, 0x15, 0x15, 0x1F, 0x00}, // 179 + {0x00, 0x00, 0x02, 0x01, 0x00}, // 180 + {0x7C, 0x20, 0x20, 0x1C, 0x20}, // 181 + {0x06, 0x4F, 0x7F, 0x01, 0x7F}, // 182 + {0x00, 0x18, 0x18, 0x00, 0x00}, // 183 + {0x00, 0x80, 0xA0, 0x40, 0x00}, // 184 + {0x00, 0x09, 0x0F, 0x08, 0x00}, // 185 + {0x26, 0x29, 0x29, 0x29, 0x26}, // 186 + {0x22, 0x14, 0x2A, 0x14, 0x08}, // 187 + {0x17, 0x08, 0x34, 0x22, 0x70}, // 188 + {0x17, 0x08, 0x04, 0x6A, 0x58}, // 189 + {0x15, 0x1F, 0x38, 0x24, 0x72}, // 190 + {0x30, 0x48, 0x45, 0x40, 0x20}, // 191 + {0x78, 0x15, 0x16, 0x14, 0x78}, // 192 + {0x78, 0x14, 0x16, 0x15, 0x78}, // 193 + {0x78, 0x16, 0x15, 0x16, 0x78}, // 194 + {0x7A, 0x15, 0x16, 0x15, 0x78}, // 195 + {0x78, 0x15, 0x14, 0x15, 0x78}, // 196 + {0x78, 0x17, 0x15, 0x17, 0x78}, // 197 + {0x7E, 0x09, 0x7E, 0x49, 0x49}, // 198 + {0x1E, 0xA1, 0xA1, 0x61, 0x12}, // 199 + {0x7C, 0x55, 0x56, 0x54, 0x44}, // 200 + {0x7C, 0x54, 0x56, 0x55, 0x44}, // 201 + {0x7C, 0x56, 0x55, 0x56, 0x44}, // 202 + {0x7C, 0x55, 0x54, 0x55, 0x44}, // 203 + {0x00, 0x45, 0x7E, 0x44, 0x00}, // 204 + {0x00, 0x44, 0x7E, 0x45, 0x00}, // 205 + {0x00, 0x46, 0x7D, 0x46, 0x00}, // 206 + {0x00, 0x45, 0x7C, 0x45, 0x00}, // 207 + {0x08, 0x7F, 0x49, 0x22, 0x1C}, // 208 + {0x7C, 0x0A, 0x11, 0x22, 0x7D}, // 209 + {0x38, 0x45, 0x46, 0x44, 0x38}, // 210 + {0x38, 0x44, 0x46, 0x45, 0x38}, // 211 + {0x38, 0x46, 0x45, 0x46, 0x38}, // 212 + {0x3A, 0x45, 0x46, 0x45, 0x38}, // 213 + {0x38, 0x45, 0x44, 0x45, 0x38}, // 214 + {0x22, 0x14, 0x08, 0x14, 0x22}, // 215 + {0x5C, 0x32, 0x2A, 0x26, 0x1D}, // 216 + {0x3C, 0x41, 0x42, 0x40, 0x3C}, // 217 + {0x3C, 0x40, 0x42, 0x41, 0x3C}, // 218 + {0x38, 0x42, 0x41, 0x42, 0x38}, // 219 + {0x3C, 0x41, 0x40, 0x41, 0x3C}, // 220 + {0x04, 0x08, 0x72, 0x09, 0x04}, // 221 + {0x41, 0x7F, 0x55, 0x14, 0x08}, // 222 + {0xFE, 0x25, 0x25, 0x25, 0x1A}, // 223 + {0x20, 0x55, 0x56, 0x54, 0x78}, // 224 + {0x20, 0x54, 0x56, 0x55, 0x78}, // 225 + {0x20, 0x56, 0x55, 0x56, 0x78}, // 226 + {0x22, 0x55, 0x56, 0x55, 0x78}, // 227 + {0x20, 0x55, 0x54, 0x55, 0x78}, // 228 + {0x20, 0x57, 0x55, 0x57, 0x78}, // 229 + {0x74, 0x54, 0x7C, 0x54, 0x5C}, // 230 + {0x18, 0xA4, 0xA4, 0x64, 0x24}, // 231 + {0x38, 0x55, 0x56, 0x54, 0x18}, // 232 + {0x38, 0x54, 0x56, 0x55, 0x18}, // 233 + {0x38, 0x56, 0x55, 0x56, 0x18}, // 234 + {0x38, 0x55, 0x54, 0x55, 0x18}, // 235 + {0x00, 0x49, 0x7A, 0x40, 0x00}, // 236 + {0x00, 0x48, 0x7A, 0x41, 0x00}, // 237 + {0x00, 0x4A, 0x79, 0x42, 0x00}, // 238 + {0x00, 0x49, 0x78, 0x41, 0x00}, // 239 + {0x30, 0x48, 0x4A, 0x3F, 0x02}, // 240 + {0x78, 0x0A, 0x09, 0x0A, 0x71}, // 241 + {0x30, 0x49, 0x4A, 0x48, 0x30}, // 242 + {0x30, 0x48, 0x4A, 0x49, 0x30}, // 243 + {0x30, 0x4A, 0x49, 0x4A, 0x30}, // 244 + {0x30, 0x4A, 0x49, 0x4A, 0x31}, // 245 + {0x30, 0x49, 0x48, 0x49, 0x30}, // 246 + {0x08, 0x08, 0x2A, 0x08, 0x08}, // 247 + {0x58, 0x24, 0x54, 0x48, 0x34}, // 248 + {0x38, 0x41, 0x42, 0x40, 0x78}, // 249 + {0x38, 0x40, 0x42, 0x41, 0x78}, // 250 + {0x38, 0x42, 0x41, 0x42, 0x78}, // 251 + {0x38, 0x41, 0x40, 0x41, 0x78}, // 252 + {0x18, 0xA0, 0xA2, 0xA1, 0x78}, // 253 + {0x00, 0xFE, 0x24, 0x24, 0x18}, // 254 + {0x18, 0xA1, 0xA0, 0xA1, 0x78} // 255 + }; } diff --git a/app/src/main/java/org/emulator/calculator/PrinterSimulatorFragment.java b/app/src/main/java/org/emulator/calculator/PrinterSimulatorFragment.java index 78474c2..0e19206 100644 --- a/app/src/main/java/org/emulator/calculator/PrinterSimulatorFragment.java +++ b/app/src/main/java/org/emulator/calculator/PrinterSimulatorFragment.java @@ -14,7 +14,6 @@ package org.emulator.calculator; -import android.annotation.SuppressLint; import android.app.Activity; import android.app.Dialog; import android.content.Context; @@ -22,7 +21,6 @@ import android.content.Intent; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; -import android.graphics.ColorMatrixColorFilter; import android.graphics.Paint; import android.graphics.Rect; import android.os.Bundle; @@ -33,6 +31,7 @@ import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.view.Window; +import android.widget.ScrollView; import android.widget.TextView; import androidx.annotation.NonNull; @@ -54,19 +53,11 @@ public class PrinterSimulatorFragment extends AppCompatDialogFragment { private static final String TAG = "PrinterSimulator"; private boolean debug = false; private PrinterSimulator printerSimulator; - private Toolbar toolbar; private TextView textViewPrinterText; + private ScrollView scrollViewPrinterText; private PrinterGraphView printerGraphView; -// ColorMatrixColorFilter colorFilterAlpha8ToRGB = new ColorMatrixColorFilter(new float[]{ -// 0, 0, 0, 1, 0, -// 0, 0, 0, 1, 0, -// 0, 0, 0, 1, 0, -// 0, 0, 0, 0, 255 -// }); - public PrinterSimulatorFragment() { - } @Override @@ -92,20 +83,25 @@ public class PrinterSimulatorFragment extends AppCompatDialogFragment { // getDialog().getWindow().setAttributes((android.view.WindowManager.LayoutParams) params); // } + @NonNull @Override public Dialog onCreateDialog(Bundle savedInstanceState) { Dialog dialog = super.onCreateDialog(savedInstanceState); - dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE); + Window window = dialog.getWindow(); + if(window != null) + window.requestFeature(Window.FEATURE_NO_TITLE); return dialog; } @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { String title = getString(Utils.resId(this, "string", "dialog_printer_simulator_title")); if(printerSimulator != null) title = printerSimulator.getTitle(); - getDialog().setTitle(title); + Dialog dialog = getDialog(); + if(dialog != null) + dialog.setTitle(title); // Inflate the layout for this fragment @@ -113,10 +109,8 @@ public class PrinterSimulatorFragment extends AppCompatDialogFragment { // Toolbar - toolbar = view.findViewById(Utils.resId(this, "id", "my_toolbar")); + Toolbar toolbar = view.findViewById(Utils.resId(this, "id", "my_toolbar")); toolbar.setTitle(title); - //toolbar.setOverflowIcon(ContextCompat.getDrawable(getActivity(), Utils.resId(this, "drawable", "ic_more_vert_white_24dp"))); - //toolbar.setLogo(R.drawable.ic_launcher); toolbar.setNavigationIcon(Utils.resId(this, "drawable", "ic_keyboard_backspace_white_24dp")); toolbar.setNavigationOnClickListener( new View.OnClickListener() { @@ -143,22 +137,24 @@ public class PrinterSimulatorFragment extends AppCompatDialogFragment { Bitmap croppedPaperBitmap = Bitmap.createBitmap(paperBitmap.getWidth(), printerSimulator.getPaperHeight(), Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(croppedPaperBitmap); Paint paint = new Paint(); - //paint.setColorFilter(colorFilterAlpha8ToRGB); canvas.drawBitmap(paperBitmap, 0, 0, paint); - File storagePath = new File(getActivity().getExternalCacheDir(), ""); - File imageFile = File.createTempFile(imageFilename, ".png", storagePath); - FileOutputStream fileOutputStream = new FileOutputStream(imageFile); - croppedPaperBitmap.compress(Bitmap.CompressFormat.PNG, 90, fileOutputStream); - fileOutputStream.close(); - String mimeType = "application/png"; - Intent intent = new Intent(android.content.Intent.ACTION_SEND); - intent.setType(mimeType); - intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - intent.putExtra(Intent.EXTRA_SUBJECT, Utils.resId(PrinterSimulatorFragment.this, "string", "message_printer_share_graphic")); - intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); - intent.putExtra(Intent.EXTRA_STREAM, FileProvider.getUriForFile(getActivity(),getActivity().getPackageName() + ".provider", imageFile)); - startActivity(Intent.createChooser(intent, getString(Utils.resId(PrinterSimulatorFragment.this, "string", "message_printer_share_graphic")))); + Activity activity = getActivity(); + if(activity != null) { + File storagePath = new File(activity.getExternalCacheDir(), ""); + File imageFile = File.createTempFile(imageFilename, ".png", storagePath); + FileOutputStream fileOutputStream = new FileOutputStream(imageFile); + croppedPaperBitmap.compress(Bitmap.CompressFormat.PNG, 90, fileOutputStream); + fileOutputStream.close(); + String mimeType = "application/png"; + Intent intent = new Intent(android.content.Intent.ACTION_SEND); + intent.setType(mimeType); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.putExtra(Intent.EXTRA_SUBJECT, Utils.resId(PrinterSimulatorFragment.this, "string", "message_printer_share_graphic")); + intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); + intent.putExtra(Intent.EXTRA_STREAM, FileProvider.getUriForFile(getActivity(), getActivity().getPackageName() + ".provider", imageFile)); + startActivity(Intent.createChooser(intent, getString(Utils.resId(PrinterSimulatorFragment.this, "string", "message_printer_share_graphic")))); + } } catch (Exception e) { e.printStackTrace(); Utils.showAlert(getActivity(), e.getMessage()); @@ -182,25 +178,22 @@ public class PrinterSimulatorFragment extends AppCompatDialogFragment { ViewPager pager = view.findViewById(Utils.resId(this, "id", "viewPagerPrinter")); pager.setAdapter(new PagerAdapter() { - @SuppressLint("ClickableViewAccessibility") - public Object instantiateItem(ViewGroup container, int position) { - switch (position) { - case 0: { - ViewGroup layoutPagePrinterText = container.findViewById(Utils.resId(PrinterSimulatorFragment.this, "id", "page_printer_text")); - textViewPrinterText = container.findViewById(Utils.resId(PrinterSimulatorFragment.this, "id", "printer_text")); - updatePaper(printerSimulator.getText()); - return layoutPagePrinterText; - } - case 1: { - ViewGroup layoutPagePrinterGraphic = container.findViewById(Utils.resId(PrinterSimulatorFragment.this, "id", "page_printer_graphic")); - ViewGroup pagePrinterGraphicContainer = container.findViewById(Utils.resId(PrinterSimulatorFragment.this, "id", "printer_graphic_container")); - printerGraphView = new PrinterGraphView(getActivity()); - printerGraphView.setBitmap(printerSimulator.getImage()); - pagePrinterGraphicContainer.addView(printerGraphView); - return layoutPagePrinterGraphic; - } + @NonNull + public Object instantiateItem(@NonNull ViewGroup container, int position) { + if (position == 0) { + ViewGroup layoutPagePrinterText = container.findViewById(Utils.resId(PrinterSimulatorFragment.this, "id", "page_printer_text")); + textViewPrinterText = container.findViewById(Utils.resId(PrinterSimulatorFragment.this, "id", "printer_text")); + scrollViewPrinterText = container.findViewById(Utils.resId(PrinterSimulatorFragment.this, "id", "printer_text_scroll")); + updatePaper(printerSimulator.getText()); + return layoutPagePrinterText; + } else { + ViewGroup layoutPagePrinterGraphic = container.findViewById(Utils.resId(PrinterSimulatorFragment.this, "id", "page_printer_graphic")); + ViewGroup pagePrinterGraphicContainer = container.findViewById(Utils.resId(PrinterSimulatorFragment.this, "id", "printer_graphic_container")); + printerGraphView = new PrinterGraphView(getActivity()); + printerGraphView.setBitmap(printerSimulator.getImage()); + pagePrinterGraphicContainer.addView(printerGraphView); + return layoutPagePrinterGraphic; } - return null; } @Override @@ -234,6 +227,7 @@ public class PrinterSimulatorFragment extends AppCompatDialogFragment { if(debug) Log.d(TAG, "updatePaper(" + textAppended + ")"); if(textViewPrinterText != null) { textViewPrinterText.append(textAppended); + scrollViewPrinterText.fullScroll(View.FOCUS_DOWN); } if(printerGraphView != null) { printerGraphView.updatePaperLayout(); @@ -370,8 +364,7 @@ public class PrinterSimulatorFragment extends AppCompatDialogFragment { @Override protected void onCustomDraw(Canvas canvas) { - //paintBitmap.setColorFilter(colorFilterAlpha8ToRGB); - canvas.drawColor(Color.BLACK); // LTGRAY); + canvas.drawColor(Color.BLACK); Rect paperclip = new Rect(0, 0, bitmap.getWidth(), printerSimulator.getPaperHeight()); canvas.drawBitmap(this.bitmap, paperclip, paperclip, paintBitmap); } diff --git a/app/src/main/java/org/emulator/calculator/Utils.java b/app/src/main/java/org/emulator/calculator/Utils.java index e30edc2..5fbb72b 100644 --- a/app/src/main/java/org/emulator/calculator/Utils.java +++ b/app/src/main/java/org/emulator/calculator/Utils.java @@ -37,7 +37,7 @@ public class Utils { toast.show(); } - public static int resId(Context context, String resourcename, String variableName) + static int resId(Context context, String resourcename, String variableName) { try { return context.getResources().getIdentifier(variableName, resourcename, context.getApplicationContext().getPackageName()); @@ -47,14 +47,16 @@ public class Utils { } } - public static int resId(Fragment context, String resourcename, String variableName) + static int resId(Fragment fragment, String resourcename, String variableName) { try { - return context.getResources().getIdentifier(variableName, resourcename, context.getContext().getApplicationContext().getPackageName()); + Context context = fragment.getContext(); + if(context != null) + return fragment.getResources().getIdentifier(variableName, resourcename, context.getApplicationContext().getPackageName()); } catch (Exception e) { e.printStackTrace(); - return -1; } + return -1; } public static String getFileName(Context context, String url) { @@ -92,7 +94,7 @@ public class Utils { } // https://community.khronos.org/t/get-maximum-texture-size/67795 - public static int getMaximumTextureSize() { + static int getMaximumTextureSize() { EGL10 egl = (EGL10) EGLContext.getEGL(); EGLDisplay display = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY); @@ -128,7 +130,7 @@ public class Utils { // Release egl.eglTerminate(display); - Log.i("GLHelper", "Maximum GL texture size: " + Integer.toString(maximumTextureSize)); + Log.i("GLHelper", "Maximum GL texture size: " + maximumTextureSize); return maximumTextureSize; } diff --git a/app/src/main/java/org/emulator/calculator/ViewPagerNoSwipe.java b/app/src/main/java/org/emulator/calculator/ViewPagerNoSwipe.java index 149b4a2..d319e2b 100644 --- a/app/src/main/java/org/emulator/calculator/ViewPagerNoSwipe.java +++ b/app/src/main/java/org/emulator/calculator/ViewPagerNoSwipe.java @@ -14,6 +14,7 @@ package org.emulator.calculator; +import android.annotation.SuppressLint; import android.content.Context; import android.util.AttributeSet; import android.view.MotionEvent; @@ -26,6 +27,7 @@ public class ViewPagerNoSwipe extends ViewPager { super(context, attrs); } + @SuppressLint("ClickableViewAccessibility") @Override public boolean onTouchEvent(MotionEvent event) { return false; diff --git a/app/src/main/java/org/emulator/forty/eight/MainActivity.java b/app/src/main/java/org/emulator/forty/eight/MainActivity.java index bc74729..c431248 100644 --- a/app/src/main/java/org/emulator/forty/eight/MainActivity.java +++ b/app/src/main/java/org/emulator/forty/eight/MainActivity.java @@ -30,6 +30,7 @@ import android.os.Bundle; import android.os.ParcelFileDescriptor; import android.preference.PreferenceManager; import android.util.Log; +import android.util.SparseArray; import android.view.HapticFeedbackConstants; import android.view.Menu; import android.view.MenuItem; @@ -40,6 +41,7 @@ import android.widget.ImageButton; import android.widget.TextView; import android.widget.Toast; +import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.ActionBarDrawerToggle; import androidx.appcompat.app.AlertDialog; @@ -334,9 +336,9 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On } @Override - public boolean onNavigationItemSelected(MenuItem item) { + public boolean onNavigationItemSelected(@NonNull MenuItem item) { // Handle navigation view item clicks here. - int id = item != null ? item.getItemId() : -1; + int id = item.getItemId(); if (id == R.id.nav_new) { OnFileNew(); } else if (id == R.id.nav_open) { @@ -544,40 +546,42 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On if(documentFile != null) { Uri fileUri = documentFile.getUri(); InputStream inputStream = getContentResolver().openInputStream(fileUri); - reader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8)); - // do reading, usually loop until end of file reading - String mLine; - boolean inGlobal = false; - String title = null; - String model = null; - while ((mLine = reader.readLine()) != null) { - //process line - if (mLine.indexOf("Global") == 0) { - inGlobal = true; - title = null; - model = null; - continue; - } - if (inGlobal) { - if (mLine.indexOf("End") == 0) { - KMLScriptItem newKMLScriptItem = new KMLScriptItem(); - newKMLScriptItem.filename = kmlFolderUseDefault ? calculatorFilename : "document:" + kmlFolderURL + "|" + calculatorFilename; - newKMLScriptItem.title = title; - newKMLScriptItem.model = model; - kmlScripts.add(newKMLScriptItem); - break; - } - - m = patternGlobalTitle.matcher(mLine); - if (m.find()) { - title = m.group(1); - } - m = patternGlobalModel.matcher(mLine); - if (m.find()) { - model = m.group(1); - } - } - } + if(inputStream != null) { + reader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8)); + // do reading, usually loop until end of file reading + String mLine; + boolean inGlobal = false; + String title = null; + String model = null; + while ((mLine = reader.readLine()) != null) { + //process line + if (mLine.indexOf("Global") == 0) { + inGlobal = true; + title = null; + model = null; + continue; + } + if (inGlobal) { + if (mLine.indexOf("End") == 0) { + KMLScriptItem newKMLScriptItem = new KMLScriptItem(); + newKMLScriptItem.filename = kmlFolderUseDefault ? calculatorFilename : "document:" + kmlFolderURL + "|" + calculatorFilename; + newKMLScriptItem.title = title; + newKMLScriptItem.model = model; + kmlScripts.add(newKMLScriptItem); + break; + } + + m = patternGlobalTitle.matcher(mLine); + if (m.find()) { + title = m.group(1); + } + m = patternGlobalModel.matcher(mLine); + if (m.find()) { + model = m.group(1); + } + } + } + } } } catch (IOException e) { //log the exception @@ -624,7 +628,6 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On if (continueCallback != null) continueCallback.run(); } else { - //TODO SaveAs... fileSaveAsCallback = continueCallback; OnFileSaveAs(); } @@ -1257,7 +1260,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On final int GENERIC_READ = 1; final int GENERIC_WRITE = 2; - Map parcelFileDescriptorPerFd = null; + SparseArray parcelFileDescriptorPerFd = null; public int openFileFromContentResolver(String fileURL, int writeAccess) { //https://stackoverflow.com/a/31677287 Uri uri = Uri.parse(fileURL); @@ -1278,11 +1281,13 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On } int fd = filePfd != null ? filePfd.getFd() : 0; if(parcelFileDescriptorPerFd == null) { - parcelFileDescriptorPerFd = new HashMap<>(); + parcelFileDescriptorPerFd = new SparseArray<>(); } parcelFileDescriptorPerFd.put(fd, filePfd); return fd; } + + @SuppressWarnings("unused") public int openFileInFolderFromContentResolver(String filename, String folderURL, int writeAccess) { Uri folderURI = Uri.parse(folderURL); DocumentFile folderDocumentFile = DocumentFile.fromTreeUri(this, folderURI); @@ -1298,6 +1303,8 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On } return -1; } + + @SuppressWarnings("unused") public int closeFileFromContentResolver(int fd) { if(parcelFileDescriptorPerFd != null) { ParcelFileDescriptor filePfd = parcelFileDescriptorPerFd.get(fd); @@ -1318,6 +1325,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On Utils.showAlert(this, text); } + @SuppressWarnings("unused") public void sendMenuItemCommand(int menuItem) { switch (menuItem) { case 1: // FILE_NEW @@ -1396,6 +1404,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On } } + @SuppressWarnings("unused") public String getFirstKMLFilenameForType(char chipsetType) { extractKMLScripts(); @@ -1422,6 +1431,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On return null; } + @SuppressWarnings("unused") public void clipboardCopyText(String text) { // Gets a handle to the clipboard service. ClipboardManager clipboard = (ClipboardManager)getSystemService(Context.CLIPBOARD_SERVICE); @@ -1431,6 +1441,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On clipboard.setPrimaryClip(clip); } } + @SuppressWarnings("unused") public String clipboardPasteText() { ClipboardManager clipboard = (ClipboardManager)getSystemService(Context.CLIPBOARD_SERVICE); if (clipboard != null && clipboard.hasPrimaryClip()) { @@ -1446,11 +1457,13 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On return ""; } + @SuppressWarnings("unused") public void performHapticFeedback() { if(sharedPreferences.getBoolean("settings_haptic_feedback", true)) mainScreenView.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING); } + @SuppressWarnings("unused") public void sendByteUdp(int byteSent) { printerSimulator.write(byteSent); } @@ -1487,9 +1500,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On case "settings_rotation": int rotationMode = 0; try { - String rotationModeValue = sharedPreferences.getString("settings_rotation", "0"); - if(rotationModeValue != null) - rotationMode = Integer.parseInt(rotationModeValue); + rotationMode = Integer.parseInt(sharedPreferences.getString("settings_rotation", "0")); } catch (NumberFormatException ex) { // Catch bad number format } @@ -1498,9 +1509,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On case "settings_auto_layout": int autoLayoutMode = 1; try { - String autoLayoutModeValue = sharedPreferences.getString("settings_auto_layout", "1"); - if(autoLayoutModeValue != null) - autoLayoutMode = Integer.parseInt(autoLayoutModeValue); + autoLayoutMode = Integer.parseInt(sharedPreferences.getString("settings_auto_layout", "1")); } catch (NumberFormatException ex) { // Catch bad number format } @@ -1532,19 +1541,15 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On mainScreenView.setBackgroundKmlColor(sharedPreferences.getBoolean("settings_background_kml_color", false)); break; case "settings_background_fallback_color": - String fallbackColor = sharedPreferences.getString("settings_background_fallback_color", "0"); try { - if(fallbackColor != null) - mainScreenView.setBackgroundFallbackColor(Integer.parseInt(fallbackColor)); + mainScreenView.setBackgroundFallbackColor(Integer.parseInt(sharedPreferences.getString("settings_background_fallback_color", "0"))); } catch (NumberFormatException ex) { // Catch bad number format } break; case "settings_printer_model": - String printerModel = sharedPreferences.getString("settings_printer_model", "1"); try { - if(printerModel != null) - printerSimulator.setPrinterModel82240A(Integer.parseInt(printerModel) == 0); + printerSimulator.setPrinterModel82240A(Integer.parseInt(sharedPreferences.getString("settings_printer_model", "1")) == 0); } catch (NumberFormatException ex) { // Catch bad number format } diff --git a/app/src/main/java/org/emulator/forty/eight/SettingsActivity.java b/app/src/main/java/org/emulator/forty/eight/SettingsActivity.java index c818dda..e488dac 100644 --- a/app/src/main/java/org/emulator/forty/eight/SettingsActivity.java +++ b/app/src/main/java/org/emulator/forty/eight/SettingsActivity.java @@ -130,7 +130,7 @@ public class SettingsActivity extends AppCompatActivity implements SharedPrefere int backgroundFallbackColor = -1; try { backgroundFallbackColor = Integer.parseInt(stringValue); - } catch (NumberFormatException ex) {} + } catch (NumberFormatException ignored) {} if(backgroundFallbackColor >= 0 && backgroundFallbackColor < stringArrayBackgroundFallbackColor.length) preference.setSummary(stringArrayBackgroundFallbackColor[backgroundFallbackColor]); // preferenceBackgroundCustomColor.setEnabled(backgroundFallbackColor == 2); @@ -216,13 +216,15 @@ public class SettingsActivity extends AppCompatActivity implements SharedPrefere intent.addCategory(Intent.CATEGORY_OPENABLE); intent.setType("*/*"); intent.putExtra(Intent.EXTRA_TITLE, "shared.bin"); - getActivity().startActivityForResult(intent, MainActivity.INTENT_PORT2LOAD); + Activity activity = getActivity(); + if(activity != null) + activity.startActivityForResult(intent, MainActivity.INTENT_PORT2LOAD); return true; } }); } - public void updatePort2LoadFilename(String port2Filename) { + void updatePort2LoadFilename(String port2Filename) { if(preferencePort2load != null) { String displayName = port2Filename; try { diff --git a/app/src/main/res/layout/activity_info.xml b/app/src/main/res/layout/activity_info.xml index 657643b..29b0d3f 100644 --- a/app/src/main/res/layout/activity_info.xml +++ b/app/src/main/res/layout/activity_info.xml @@ -7,6 +7,7 @@ android:id="@+id/textViewInfo" android:layout_width="fill_parent" android:layout_height="wrap_content" - android:padding="5dp" /> + android:padding="5dp" + android:textIsSelectable="true" /> diff --git a/app/src/main/res/layout/tab_content_page_printer_graphic.xml b/app/src/main/res/layout/tab_content_page_printer_graphic.xml index 34ad447..b94e836 100644 --- a/app/src/main/res/layout/tab_content_page_printer_graphic.xml +++ b/app/src/main/res/layout/tab_content_page_printer_graphic.xml @@ -1,10 +1,9 @@ - + + + + diff --git a/app/src/main/res/layout/tab_content_page_printer_text.xml b/app/src/main/res/layout/tab_content_page_printer_text.xml index 9b10a11..7c5120b 100644 --- a/app/src/main/res/layout/tab_content_page_printer_text.xml +++ b/app/src/main/res/layout/tab_content_page_printer_text.xml @@ -1,6 +1,5 @@ - - + app:layout_constraintTop_toTopOf="parent" > + + + + +