-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9d273b0
commit 1e63045
Showing
13 changed files
with
70 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "commons/freetype2errors.h" | ||
|
||
extern "C" { | ||
|
||
JNIEXPORT void JNICALL | ||
Java_com_nikialeksey_freetype2_glyph_NativeGlyph_charSize(JNIEnv *env, jclass cls, jlong face, | ||
jlong width, jlong height, | ||
jint hResolution, jint vResolution) { | ||
FT_Error error = FT_Set_Char_Size((FT_Face) face, (FT_F26Dot6) width, (FT_F26Dot6) height, | ||
(FT_UInt) hResolution, (FT_UInt) vResolution); | ||
if (error) { | ||
throwException(env, error); | ||
} | ||
} | ||
|
||
JNIEXPORT void JNICALL | ||
Java_com_nikialeksey_freetype2_glyph_NativeGlyph_loadChar(JNIEnv *env, jclass cls, jlong face, jchar character) { | ||
FT_Error error = FT_Load_Char((FT_Face) face, (FT_ULong) character, FT_LOAD_RENDER); | ||
if (error) { | ||
throwException(env, error); | ||
} | ||
} | ||
|
||
} |
13 changes: 11 additions & 2 deletions
13
freetype2/src/main/java/com/nikialeksey/freetype2/exceptions/Freetype2Exception.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
package com.nikialeksey.freetype2.exceptions; | ||
|
||
public interface Freetype2Exception { | ||
String message(); | ||
public class Freetype2Exception extends RuntimeException { | ||
private final String message; | ||
|
||
public Freetype2Exception(final String message) { | ||
this.message = message; | ||
} | ||
|
||
public String message() { | ||
return message; | ||
} | ||
} | ||
|
15 changes: 0 additions & 15 deletions
15
freetype2/src/main/java/com/nikialeksey/freetype2/exceptions/Initialize.java
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
freetype2/src/main/java/com/nikialeksey/freetype2/exceptions/Release.java
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
freetype2/src/main/java/com/nikialeksey/freetype2/face/exceptions/Initialize.java
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
freetype2/src/main/java/com/nikialeksey/freetype2/face/exceptions/Release.java
This file was deleted.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
freetype2/src/main/java/com/nikialeksey/freetype2/glyph/Glyph.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.nikialeksey.freetype2.glyph; | ||
|
||
public interface Glyph { | ||
} |
22 changes: 22 additions & 0 deletions
22
freetype2/src/main/java/com/nikialeksey/freetype2/glyph/NativeGlyph.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.nikialeksey.freetype2.glyph; | ||
|
||
import com.nikialeksey.freetype2.face.Face; | ||
|
||
public class NativeGlyph implements Glyph { | ||
private final long faceAddress; | ||
|
||
public NativeGlyph(Face face) { | ||
faceAddress = face.address(); | ||
// @todo #3:30m set charSize and loadChar | ||
// @todo #4:30m get char bitmap | ||
} | ||
|
||
private native void charSize(long faceAddress, long width, long height, long hResolution, | ||
long vResolution); | ||
|
||
private native void loadChar(long faceAddress, char character); | ||
|
||
static { | ||
System.loadLibrary("Freetype2Glyph"); | ||
} | ||
} |
1e63045
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Puzzle
3-da6ea56c
discovered infreetype2/src/main/java/com/nikialeksey/freetype2/glyph/NativeGlyph.java
and submitted as #3.1e63045
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Puzzle
4-642155c9
discovered infreetype2/src/main/java/com/nikialeksey/freetype2/glyph/NativeGlyph.java
and submitted as #4.1e63045
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't able to retrieve PDD puzzles from the code base (if you think that it's a bug on your our side, please submit it to yegor256/0pdd):